ACTIONS & SURFACES
Banner
Inline notification surface. Four tone variants (info, success, warning, danger), an optional title, an optional dismiss button, and an icon slot that defaults to a tone-aware glyph but accepts any ReactNode.
Import
Variants
Heads up
Your trial ends in 7 days. Upgrade to keep your projects.
Saved
Settings have been updated.
Quota at 90%
You’ll hit the storage cap by Friday.
Action required
Payment failed — update your card.
Dismissible
Pass dismissible to add a close affordance. The banner clears its local state on click; pair with onDismiss to persist the dismissal (e.g. save to localStorage so it doesn't come back).
No icon
Drop the leading icon when the banner is purely text-driven.
Saved
Use icon={false} to drop the leading icon entirely.
Props
Banner props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'info' | 'success' | 'warning' | 'danger' | 'info' | Sets the background tint, the Memphis shadow color, and the default leading icon. danger also switches the wrapper role to alert for screen readers. |
| title | ReactNode | — | Optional bold heading rendered before the body. |
| icon | ReactNode | false | — | Override the variant default icon. Pass false to drop the icon entirely; pass any ReactNode to substitute a custom glyph. |
| dismissible | boolean | false | When true, renders an X button on the trailing edge that hides the banner from local state. |
| onDismiss | () => void | — | Fires when the user clicks the dismiss button. Use it to persist the dismissal. |
| dismissLabel | string | 'Chiudi' | Aria label for the dismiss button. |
| children | ReactNode | — | Body content rendered below the title. |
Accessibility
- The wrapper renders
role="status"forinfo,successandwarning;role="alert"fordanger. - Live-region note:
alertandstatusonly fire announcements when the banner is inserted into an already-mounted DOM. A banner present in the initial server render is read in document order, not as an interrupt — mount it dynamically (after a network response, after dismissing a modal, etc.) when you need the announcement. - Icons are
aria-hidden— the title and body carry the message. - The dismiss button gets
aria-labelfromdismissLabel(defaults to"Chiudi").