Feedback
Banner
Page-level message about a state that affects everything below it.
- Experimental
- Keyboard tested
- Screen reader not tested yet
Playground
Sync paused
<Banner title="Sync paused">
Changes are saved on this device until the connection is back.
</Banner>Usage
When to use
Use a banner for a state that affects everything on the page below it: demo data instead of live data, a sync that failed, planned maintenance. It sits at the top of the content it concerns and stays until the state changes or the person dismisses it.
When not to use
- The result of one form or one action: use InlineMessage next to it.
- A list or table with nothing in it: use EmptyState.
- Anything that needs a decision before the person can go on: use Dialog.
How it works
The tone sets the icon, the tinted fill and the name of the region: Information, Success, Warning, Error or Note. An optional action (a Link or Button) resolves the state. With dismissible, a Dismiss button hides the banner for this visit; focus then stays where the banner was instead of jumping to the top of the page. On small screens the action moves below the text.
Content guidelines
Title: the state in a few words (“Sync failed”, “Demo data”). Body: one sentence on what it means for the person. Action: the verb that fixes it (“Try again”). Don't write a danger banner that can be dismissed while the problem persists.
Do and don’t
- One banner per page, at the top of the content it concerns.
- Don't use a banner for the result of a single form; use InlineMessage there.
- Don't make danger banners dismissible while the problem persists.
Anatomy
- containerTinted card with a border in the tone colour, a labelled region.
- iconTone icon, same size as the title text.
- titleSemibold body text.
- bodySmall text.
- actionsOptional action, then Dismiss; stacked under the text on small screens.
- dismiss-buttonGhost button with the banner title in its accessible name.
Examples
Info, dismissible
Demo data
Danger with action
Sync failed
Caution
Maintenance on Friday
Props
| Name | Type | Default | Description |
|---|---|---|---|
| tone | "neutral" | "positive" | "caution" | "info" | "danger" | "info" | Sets icon, tint and the label of the region. |
| title (required) | string | – | The state in a few words. |
| children | ReactNode | – | One sentence of detail. |
| action | ReactNode | – | A Link or Button that resolves the state. |
| dismissible | boolean | false | Adds a Dismiss button; hides the banner for this visit. |
Tokens used
| Token | Tier | Value | Utility |
|---|---|---|---|
| card.radius | component | 16px | |
| spacing.0 | semantic | 0px | |
| spacing.1 | semantic | 4px | |
| spacing.3 | semantic | 12px | |
| spacing.4 | semantic | 16px | |
| spacing.6 | semantic | 24px | |
| spacing.8 | semantic | 32px | |
| text.primary | semantic | #0A0A0B | |
| type.small.size | semantic | 14px | |
| weight.semibold | semantic | 600 |
Accessibility
| Check | How | Status |
|---|---|---|
| axe-core rules | Automated on every npm run check, at desktop and mobile width | Runs on every build |
| Keyboard | Automated Playwright test (scripts/keyboard.mjs) | Tested |
| Screen reader | Manual | Not tested yet |
Keyboard
| Key | Action |
|---|---|
| Tab | Moves to the action, then to Dismiss. |
| Enter / Space | Dismisses the banner. |
Semantics and focus
- Rendered as a region named after tone and title, so it shows up in the landmark list.
- Not a live region: banners are present on load. For messages after an action use InlineMessage with announce.
- Dismiss names the banner it closes.