Banner
Highlights important information or required actions prominently within the interface. Use to communicate statuses, provide feedback, or draw attention to critical updates.
Anchor to propertiesProperties
- Anchor to collapsiblecollapsiblebooleanDefault: false
Makes the content collapsible. A collapsible banner will conceal child elements initially, but allow the user to expand the banner to see them.
- Anchor to dismissibledismissiblebooleanDefault: false
Determines whether the close button of the banner is present.
When the close button is pressed, the
dismiss
event will fire, thenhidden
will be true, any animation will complete, and theafterhide
event will fire.- Anchor to headingheadingstringDefault: ''
The title of the banner.
- booleanDefault: false
Determines whether the banner is hidden.
If this property is being set on each framework render (as in 'controlled' usage), and the banner is
dismissible
, ensure you update app state for this property when thedismiss
event fires.If the banner is not
dismissible
, it can still be hidden by setting this property.- string
A unique identifier for the element.
- Anchor to tonetone'success' | 'auto' | 'info' | 'warning' | 'critical'
Sets the tone of the Banner, based on the intention of the information being conveyed.
The banner is a live region and the type of status will be dictated by the Tone selected.
critical
creates an assertive live region that is announced by screen readers immediately.neutral
,info
,success
,warning
andcaution
creates an informative live region that is announced by screen readers after the current message.
BannerElementProps
- collapsible
Makes the content collapsible. A collapsible banner will conceal child elements initially, but allow the user to expand the banner to see them.
boolean
- dismissible
Determines whether the close button of the banner is present. When the close button is pressed, the `dismiss` event will fire, then `hidden` will be true, any animation will complete, and the `afterhide` event will fire.
boolean
- heading
The title of the banner.
string
- hidden
Determines whether the banner is hidden. If this property is being set on each framework render (as in 'controlled' usage), and the banner is `dismissible`, ensure you update app state for this property when the `dismiss` event fires. If the banner is not `dismissible`, it can still be hidden by setting this property.
boolean
- id
A unique identifier for the element.
string
- tone
Sets the tone of the Banner, based on the intention of the information being conveyed. The banner is a live region and the type of status will be dictated by the Tone selected. - `critical` creates an [assertive live region](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/alert_role) that is announced by screen readers immediately. - `neutral`, `info`, `success`, `warning` and `caution` creates an [informative live region](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/status_role) that is announced by screen readers after the current message.
'success' | 'auto' | 'info' | 'warning' | 'critical'
export interface BannerElementProps extends Pick<BannerProps$1, 'collapsible' | 'dismissible' | 'heading' | 'hidden' | 'id' | 'tone'> {
tone?: Extract<BannerProps$1['tone'], 'auto' | 'info' | 'success' | 'warning' | 'critical'>;
}
Anchor to eventsEvents
- Anchor to afterhideafterhide((event: CallbackEventListener<typeof tagName>) => void) | null
Event handler when the banner has fully hidden.
The
hidden
property will betrue
when this event fires.- Anchor to dismissdismiss((event: CallbackEventListener<typeof tagName>) => void) | null
Event handler when the banner is dismissed by the user.
This does not fire when setting
hidden
manually.The
hidden
property will befalse
when this event fires.
BannerElementEvents
- afterhide
Event handler when the banner has fully hidden. The `hidden` property will be `true` when this event fires.
((event: CallbackEventListener<typeof tagName>) => void) | null
- dismiss
Event handler when the banner is dismissed by the user. This does not fire when setting `hidden` manually. The `hidden` property will be `false` when this event fires.
((event: CallbackEventListener<typeof tagName>) => void) | null
export interface BannerElementEvents {
/**
* Event handler when the banner has fully hidden.
*
* The `hidden` property will be `true` when this event fires.
*
* @implementation If implementations animate the hiding of the banner,
* this event must fire after the banner has fully hidden.
* We can add an `onHide` event in future if we want to provide a hook for the start of the animation.
*/
afterhide?: ((event: CallbackEventListener<typeof tagName>) => void) | null;
/**
* Event handler when the banner is dismissed by the user.
*
* This does not fire when setting `hidden` manually.
*
* The `hidden` property will be `false` when this event fires.
*/
dismiss?: ((event: CallbackEventListener<typeof tagName>) => void) | null;
}
CallbackEventListener
(EventListener & {
(event: CallbackEvent<TTagName, TEvent>): void;
}) | null
CallbackEvent
TEvent & {
currentTarget: HTMLElementTagNameMap[TTagName];
}
Code
examples
Code
<s-banner heading="Free shipping on all orders." tone="info"> </s-banner>
Preview

Anchor to best-practicesBest Practices
Use banners thoughtfully and sparingly, and only for the most important information. Too many banners distract customers from completing checkout.
Banners are typically displayed at the top of a page or a section, if they relate to specific content. Place banners below the relevant page or section header.
Include a Button component with next steps when possible.
Make banners dismissible, unless they contain critical information or an important step that customers need to take.
Use the
info
banner to update customers about a change or to give them advice.Use the
warning
banner to display information that needs attention or that customers need to take action on. Warning banners can be stressful for customers, so be cautious about using them.Use the
critical
banner to communicate problems that customers need to resolve immediately to complete checkout.