Skip to main content

Banner

The banner component highlights important information or required actions. Use banners to communicate critical updates, warnings, informational messages, or success notifications that require merchant attention.

Banners provide persistent visibility. Use the hidden property to show or hide a banner programmatically.

  • System alerts: Display alerts about maintenance, outages, or important updates.
  • Error messages: Show critical errors like payment failures or connectivity issues.
  • Success feedback: Communicate successful completion of actions like order processing or sync.
  • Warnings: Alert merchants to low inventory, expired payments, or business-critical conditions.

Configure the following properties on the banner component.

string
Default: ''

The title of the banner.

boolean
Default: false

Determines whether the banner is hidden.

string

A unique identifier for the element.

'auto' | 'info' | 'success' | 'warning' | 'critical'
Default: 'auto'

Sets the tone of the banner, based on the intention of the information being conveyed.

The banner component supports slots for additional content placement within the banner. Learn more about using slots.

Anchor to primary-action
primary-action
HTMLElement

The action taken when the banner is pressed.


Anchor to Display important messages with a bannerDisplay important messages with a banner

Display messages with headings and severity tones. This example shows every tone side by side; in production, show one banner at a time.

Display important messages with a banner

Banners illustrating different headings and severity tones.

Display important messages with a banner

<s-banner heading="Marked as delivered" tone="success">
<s-button slot="primary-action" onClick={handleDismiss}>Dismiss</s-button>
</s-banner>

<s-banner heading="Ready for shipping" tone="info">
<s-button slot="primary-action" onClick={handleDismiss}>Dismiss</s-button>
</s-banner>

<s-banner heading="Couldn't restock items" tone="warning">
<s-button slot="primary-action" onClick={handleDismiss}>Dismiss</s-button>
</s-banner>

<s-banner heading="Action failed. Contact developer" tone="critical">
<s-button slot="primary-action" onClick={handleDismiss}>Dismiss</s-button>
</s-banner>

  • Apply appropriate tones: Use critical for errors requiring immediate action, warning for important notices, success for confirmations, info for general information.
  • Keep headings concise: Write brief headings that clearly communicate the message.
  • Show one banner at a time: Display only one banner to avoid overwhelming the interface. Prioritize by importance.
  • Include clear actions: If action is needed, use the primaryAction slot to provide clear next steps.
  • Use for persistent messages: Use banners for messages that need to persist. For temporary notifications, consider toast notifications.

Was this page helpful?