Skip to content

Feedback

Banner

Page-level message about a state that affects everything below it.

  • Experimental
  • Keyboard tested
  • Screen reader not tested yet

Updated 2026-11-12

Playground

Change the props. The controls come from the documented props.

Sync paused

Changes are saved on this device until the connection is back.
tsx
<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

Do
  • One banner per page, at the top of the content it concerns.
Don’t
  • 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

The parts of the component and what each one does, as in the playground above.
  1. containerTinted card with a border in the tone colour, a labelled region.
  2. iconTone icon, same size as the title text.
  3. titleSemibold body text.
  4. bodySmall text.
  5. actionsOptional action, then Dismiss; stacked under the text on small screens.
  6. dismiss-buttonGhost button with the banner title in its accessible name.

Examples

Type-checked, and the same code goes into the AI manifest. Import: import { Banner } from "@/ds";

Info, dismissible

Demo data

The figures on this page are examples, not live data.

Danger with action

Sync failed

Changes since 10:42 are not saved yet.

Caution

Maintenance on Friday

Requests can’t be sent between 18:00 and 20:00.

Props

Checked against the component's TypeScript type on every build.
Banner props
NameTypeDefaultDescription
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.
childrenReactNode–One sentence of detail.
actionReactNode–A Link or Button that resolves the state.
dismissiblebooleanfalseAdds a Dismiss button; hides the banner for this visit.

Tokens used

Derived from the utility classes in the component's source. Copy a class with one click.
Tokens used by Banner
TokenTierValueUtility
card.radiuscomponent16px
spacing.0semantic0px
spacing.1semantic4px
spacing.3semantic12px
spacing.4semantic16px
spacing.6semantic24px
spacing.8semantic32px
text.primarysemantic#0A0A0B
type.small.sizesemantic14px
weight.semiboldsemantic600

Accessibility

What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
Testing status by check
CheckHowStatus
axe-core rulesAutomated on every npm run check, at desktop and mobile widthRuns on every build
KeyboardAutomated Playwright test (scripts/keyboard.mjs)Tested
Screen readerManualNot tested yet

Keyboard

Banner keyboard interactions
KeyAction
TabMoves to the action, then to Dismiss.
Enter / SpaceDismisses 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.