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.

Banner

Use banners to communicate important messages to buyers in a prominent way.

Support
Targets (50)

Supported targets


Anchor to collapsible
collapsible
boolean
Default: false

Whether the banner content can be collapsed and expanded by the user. A collapsible banner conceals child elements initially, allowing the user to expand the banner to reveal them.

string

A unique identifier for the component. Use this to target the component in scripts or stylesheets, or to distinguish it from other instances of the same component.

Anchor to onDismiss
onDismiss
() => void

A callback that fires when the banner is dismissed by the user. This component is controlled, so you must manage the visibility of the banner in state by using the onDismiss callback.

Anchor to status
status
Default: 'info'

The semantic meaning and color treatment of the banner.

Anchor to title
title
string

The title text displayed at the top of the banner to summarize the message or alert.


Basic Banner

Example

Basic Banner

import {
reactExtension,
Banner,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);

function Extension() {
return (
<Banner
status="critical"
title="Your payment details couldn’t be verified. Check your card details and try again."
/>
);
}
import {extension, Banner} from '@shopify/ui-extensions/checkout';

export default extension('purchase.checkout.block.render', (root) => {
const banner = root.createComponent(Banner, {
status: 'critical',
title:
'Your payment details couldn’t be verified. Check your card details and try again.',
});

root.appendChild(banner);
});

  • Use banners sparingly: Too many banners distract buyers from completing checkout. Reserve them for the most important information.

  • Place banners contextually: Display banners at the top of a page or section, below the relevant header. If a banner relates to specific content, place it near that content.

  • Include a next step when possible: Add a Button component with a clear action so buyers know what to do after reading the message.

  • Make banners dismissible unless critical: Buyers should be able to dismiss informational banners. Keep critical banners persistent until the issue is resolved.

  • Match status to urgency: Use info for general updates, warning for issues needing attention, success for confirmations, and critical for problems that block progress.


ValueDescription
"info"Convey general information or actions that aren’t critical or tied to a particular action..
"success"Use rarely, only if you need additional visual confirmation that a non-standard action has been completed successfully, for example adding an item to an order as an upsell.
"warning"Display information that needs attention or that buyers should take action on. Seeing these banners can be stressful for buyers so be cautious about using them. Should not block progress to next step.
"critical"Communicate problems that have to be resolved immediately for buyers to complete a task. For example, using a different payment method if card details couldn’t be processed. Seeing these banners can be stressful for buyers so be cautious about using them.

Was this page helpful?