Toast API
The Toast API lets you show brief, non-disruptive notification messages to customers. Use this API to confirm successful actions, surface errors, or provide lightweight feedback that appears temporarily and dismisses automatically.
Anchor to Use casesUse cases
- Confirm a completed action: Show a success toast after the customer saves a preference, submits a form, or completes an operation.
- Surface an error message: Display an error toast when a backend request fails or an action can't be completed, so the customer knows something went wrong.
- Provide status updates: Notify the customer that a background process like data syncing or a submission has completed.
Supported targets
- customer-account.
footer. render-after - customer-account.
order-index. announcement. render - customer-account.
order-index. block. render - customer-account.
order-status. announcement. render - customer-account.
order-status. block. render - customer-account.
order-status. cart-line-item. render-after - customer-account.
order-status. cart-line-list. render-after - customer-account.
order-status. customer-information. render-after - customer-account.
order-status. fulfillment-details. render-after - customer-account.
order-status. payment-details. render-after - customer-account.
order-status. return-details. render-after - customer-account.
order-status. unfulfilled-items. render-after - customer-account.
order. action. menu-item. render - customer-account.
order. action. render - customer-account.
order. page. render - customer-account.
page. render - customer-account.
profile. addresses. render-after - customer-account.
profile. announcement. render - customer-account.
profile. block. render - customer-account.
profile. company-details. render-after - customer-account.
profile. company-location-addresses. render-after - customer-account.
profile. company-location-payment. render-after - customer-account.
profile. company-location-staff. render-after - customer-account.
profile. payment. render-after
Supported targets
- customer-account.
footer. render-after - customer-account.
order-index. announcement. render - customer-account.
order-index. block. render - customer-account.
order-status. announcement. render - customer-account.
order-status. block. render - customer-account.
order-status. cart-line-item. render-after - customer-account.
order-status. cart-line-list. render-after - customer-account.
order-status. customer-information. render-after - customer-account.
order-status. fulfillment-details. render-after - customer-account.
order-status. payment-details. render-after - customer-account.
order-status. return-details. render-after - customer-account.
order-status. unfulfilled-items. render-after - customer-account.
order. action. menu-item. render - customer-account.
order. action. render - customer-account.
order. page. render - customer-account.
page. render - customer-account.
profile. addresses. render-after - customer-account.
profile. announcement. render - customer-account.
profile. block. render - customer-account.
profile. company-details. render-after - customer-account.
profile. company-location-addresses. render-after - customer-account.
profile. company-location-payment. render-after - customer-account.
profile. company-location-staff. render-after - customer-account.
profile. payment. render-after
Anchor to PropertiesProperties
The shopify global object provides toast notification functionality for customer account extensions. Access the following properties on shopify to show brief, non-blocking notification messages to the customer.
- Anchor to toasttoasttoastToastApiToastApirequiredrequired
Displays brief, non-blocking messages at the bottom of the page to confirm actions or report errors. Use noun + past tense verb format (for example,
Changes saved). For persistent messages, use a Banner component instead.
ToastApi
Displays brief, non-blocking notification messages to the customer. Use the Toast API to confirm successful actions, report errors, or surface contextual feedback without interrupting the customer workflow.
- show
Show a toast notification with the given message. Returns a handle with a `hide()` method to dismiss the toast programmatically.
(content: string) => Promise<ToastApiResult>
ToastApiResult
A handle returned by `ToastApi.show()`. Call `hide()` to dismiss the toast notification programmatically.
- hide
Dismisses the toast notification.
() => void
Anchor to Best practicesBest practices
- Keep messages short: Toast messages should be a few words that confirm what happened, like "Preferences saved" or "Submitted successfully". Avoid long sentences.
- Don't rely on toasts for critical information: Toasts disappear automatically. If the customer needs to take action, use a banner or inline message instead.
Anchor to LimitationsLimitations
- Toast messages dismiss automatically after a short duration. You can't control how long they remain visible.
- Only one toast can be displayed at a time. If you trigger multiple toasts in quick succession, earlier ones may be replaced.
- Toast notifications don't support interactive elements like links or buttons. Use them for passive feedback only.