Toast
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. This API is modeled after the Web Notification API.
The Toast.show method displays a Toast notification in the Shopify admin. It accepts a variety of options to customize the behavior.
Anchor to show method-parametersParameters
- Anchor to messagemessagestringrequired
- Anchor to optsoptsToastOptions
Anchor to show method-returnsReturnsstring
ToastOptions
- actionContent of an action button. string
- durationThe length of time in milliseconds the toast message should persist. number
- isErrorDisplay an error-styled toast. boolean
- onActionCallback fired when the action button is clicked. () => void
- onDismissCallback fired when the dismiss icon is clicked () => void
export interface ToastOptions {
  /**
   * The length of time in milliseconds the toast message should persist.
   * @defaultValue 5000
   */
  duration?: number;
  /**
   * Display an error-styled toast.
   * @defaultValue false
   */
  isError?: boolean;
  /**
   * Content of an action button.
   */
  action?: string;
  /**
   * Callback fired when the action button is clicked.
   */
  onAction?: () => void;
  /**
   * Callback fired when the dismiss icon is clicked
   */
  onDismiss?: () => void;
}Anchor to hide methodhide method(
The Toast.hide method hides a Toast notification. This is not required to be called as the Toast notification will automatically hide after the duration has elapsed.
Anchor to hide method-parametersParameters
- stringrequired
Anchor to hide method-returnsReturnsvoid
Toast
Examples
- Toast- Default- shopify.toast.show('Message sent');
Preview

Anchor to examplesExamples
Toasts with different options
Anchor to example-toast-with-durationToast with duration
Toast with duration
Anchor to example-toast-with-actionToast with action
Toast with action
Anchor to example-toast-with-dismiss-callbackToast with dismiss callback
Toast with dismiss callback
Toast with duration
Examples
- Toast with duration- Description- Toast with duration - Default- shopify.toast.show('Product saved', { duration: 5000, });
- Toast with action- Description- Toast with action - Default- shopify.toast.show('Product saved', { action: 'Undo', onAction: () => {}, // Undo logic });
- Toast with dismiss callback- Description- Toast with dismiss callback - Default- shopify.toast.show('Product saved', { onDismiss: () => {}, // Dismiss logic });