Banner
The banner component highlights important information or required actions prominently within the interface. Use banners to communicate statuses, provide feedback, draw attention to critical updates, or guide buyers toward necessary actions.
Banners support multiple tones to convey urgency levels, optional actions for next steps, and can be positioned contextually within sections or page-wide at the top. For inline status indicators on individual items, use badge.
Supported targets
- purchase.
checkout. actions. render-before - purchase.
checkout. block. render - purchase.
checkout. cart-line-item. render-after - purchase.
checkout. cart-line-list. render-after - purchase.
checkout. contact. render-after - purchase.
checkout. delivery-address. render-after - purchase.
checkout. delivery-address. render-before - purchase.
checkout. footer. render-after - purchase.
checkout. header. render-after - purchase.
checkout. payment-method-list. render-after - purchase.
checkout. payment-method-list. render-before - purchase.
checkout. pickup-location-list. render-after - purchase.
checkout. pickup-location-list. render-before - purchase.
checkout. pickup-location-option-item. render-after - purchase.
checkout. pickup-point-list. render-after - purchase.
checkout. pickup-point-list. render-before - purchase.
checkout. reductions. render-after - purchase.
checkout. reductions. render-before - purchase.
checkout. shipping-option-item. details. render - purchase.
checkout. shipping-option-item. render-after - purchase.
checkout. shipping-option-list. render-after - purchase.
checkout. shipping-option-list. render-before - purchase.
thank-you. announcement. render - purchase.
thank-you. block. render - purchase.
thank-you. cart-line-item. render-after - purchase.
thank-you. cart-line-list. render-after - purchase.
thank-you. customer-information. render-after - purchase.
thank-you. footer. render-after - purchase.
thank-you. header. render-after
Supported targets
- purchase.
checkout. actions. render-before - purchase.
checkout. block. render - purchase.
checkout. cart-line-item. render-after - purchase.
checkout. cart-line-list. render-after - purchase.
checkout. contact. render-after - purchase.
checkout. delivery-address. render-after - purchase.
checkout. delivery-address. render-before - purchase.
checkout. footer. render-after - purchase.
checkout. header. render-after - purchase.
checkout. payment-method-list. render-after - purchase.
checkout. payment-method-list. render-before - purchase.
checkout. pickup-location-list. render-after - purchase.
checkout. pickup-location-list. render-before - purchase.
checkout. pickup-location-option-item. render-after - purchase.
checkout. pickup-point-list. render-after - purchase.
checkout. pickup-point-list. render-before - purchase.
checkout. reductions. render-after - purchase.
checkout. reductions. render-before - purchase.
checkout. shipping-option-item. details. render - purchase.
checkout. shipping-option-item. render-after - purchase.
checkout. shipping-option-list. render-after - purchase.
checkout. shipping-option-list. render-before - purchase.
thank-you. announcement. render - purchase.
thank-you. block. render - purchase.
thank-you. cart-line-item. render-after - purchase.
thank-you. cart-line-list. render-after - purchase.
thank-you. customer-information. render-after - purchase.
thank-you. footer. render-after - purchase.
thank-you. header. render-after
Anchor to PropertiesProperties
Configure the following properties on the banner component.
- booleanbooleanDefault: falseDefault: 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.
- booleanbooleanDefault: falseDefault: false
Whether the banner displays a close button that allows users to dismiss it.
When the close button is pressed, the
dismissevent will fire, thenhiddenwill be set totrue, any animation will complete, and theafterhideevent will fire.- stringstringDefault: ''Default: ''
The heading text displayed at the top of the banner to summarize the message or alert.
- booleanbooleanDefault: falseDefault: false
Controls whether the banner is visible or hidden.
When using a controlled component pattern and the banner is
dismissible, update this property totruewhen thedismissevent fires.You can hide the banner programmatically by setting this to
trueeven if it's notdismissible.- stringstring
A unique identifier for the element. Use this to reference the element in JavaScript, link labels to form controls, or target specific elements for styling or scripting.
- 'success' | 'info' | 'auto' | 'warning' | 'critical''success' | 'info' | 'auto' | 'warning' | 'critical'Default: 'auto'Default: 'auto'
The semantic meaning and color treatment of the component. The banner is a live region and the type of status is dictated by the tone selected.
info: Informational content or helpful tips.auto: Automatically determined based on context.success: Positive outcomes or successful states.warning: Important warnings about potential issues.critical: Urgent problems or destructive actions.
The
criticaltone creates an assertive live region that is announced by screen readers immediately. Theinfo,success, andwarningtones create an informative live region that is announced by screen readers after the current message.
Anchor to EventsEvents
The banner component provides event callbacks for handling user interactions. Learn more about handling events.
- CallbackEventListener<typeof tagName>CallbackEventListener<typeof tagName>
A callback that fires when the banner has fully hidden, including after any hide animations have completed.
The
hiddenproperty istruewhen this event fires.- CallbackEventListener<typeof tagName>CallbackEventListener<typeof tagName>
A callback that fires when the banner is dismissed by the user clicking the close button.
This doesn't fire when setting
hiddenmanually.The
hiddenproperty isfalsewhen this event fires.
CallbackEventListener
A typed event listener for custom element events. The listener receives a `CallbackEvent` with the correct `currentTarget` type for the associated custom element tag.
(EventListener & {
(event: CallbackEvent<TTagName, Event> & TData): void;
}) | nullCallbackEvent
An event type that narrows the `currentTarget` to the specific HTML element associated with the custom element tag. This provides type-safe event handling in callback listeners.
TEvent & {
currentTarget: HTMLElementTagNameMap[TTagName];
}Anchor to ExamplesExamples
Anchor to Display a basic notificationDisplay a basic notification
Display a basic notification to the buyer. This example renders an s-banner with an info tone and a heading to communicate a free shipping promotion.
Display a basic notification

html
Present a warning buyers can dismiss. This example combines warning tone with dismissible for address verification details.
html
Anchor to Confirm a successful actionConfirm a successful action
Confirm to buyers when they successfully complete an action. This example shows an s-banner confirming a discount application with tone="success" and a short savings summary.
html
Anchor to Best practicesBest practices
- 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 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
criticalbanners persistent until the issue is resolved. - Match tone to urgency: The default tone is
auto, which adapts to context. Useinfofor general updates,warningfor issues needing attention,successfor confirmations, andcriticalfor problems that must be resolved to complete checkout. - Use the
criticaltone sparingly: Thecriticaltone creates an assertive live region that screen readers announce immediately. Overusing it overwhelms buyers using assistive technology.