Skip to main content

Toast API

The Toast API displays a non-disruptive message that appears at the bottom of the interface to provide quick and short feedback on the outcome of an action. App Home UI extensions access toast notifications through shopify.toast on the shopify global object. This API is modeled after the Web Notification API.

  • Success feedback: Show confirmation messages after successful save, create, or update operations.
  • Error notification: Display non-blocking error messages when operations fail.
  • Action buttons: Include action buttons in toasts for quick follow-up actions like undoing changes.
  • Temporary alerts: Communicate brief, time-limited messages that don't require user acknowledgment.

The ToastApi object provides methods for displaying temporary notification messages. Access these methods through shopify.toast to show user feedback and status updates.

() => void
required

Dismisses any currently visible toast notification. Use this to programmatically hide a toast before its duration expires.

(message: string, options?: ) => void
required

Displays a toast notification with the specified message. The toast appears as a temporary overlay that automatically dismisses after the specified duration. Use for providing immediate user feedback, confirming actions, or communicating status updates without interrupting the user's workflow.


Was this page helpful?