Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

UI API

The UI API lets you display brief, non-disruptive notification messages to customers using toast notifications. Use this API to confirm successful actions, report errors, or surface contextual feedback without interrupting the customer workflow.

Note

In API version 2025-10 and later, this functionality moved to the Toast API.

  • 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.
Support
Targets (25)

The UI API object provides toast notification functionality for customer account extensions. Access the following properties on the API object to show brief, non-blocking notification messages to the customer.

required

Triggers platform-level UI interactions, such as displaying toast notifications. Use this to show success or error messages in response to customer actions.


  • Keep messages short: Toast messages should be a few words that confirm what happened, like "Selection 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.

  • 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.

Was this page helpful?