Banner
Feedback

Banner

Full-width alert strip for incidents, drafts, and system-wide notices. Appears between app chrome and content.

Component behavior

Banner is page-level and persistent: it describes a condition that holds until something changes, such as degraded service, an expiring trial, or a read-only environment. It occupies space in the layout rather than floating over it.

Use cases
  • Conditions affecting the page or account.
  • Persistent information that does not require immediate action.
  • Environment indicators such as staging, impersonation, or read-only mode.
Alternatives

Toast: feedback reports a completed action and does not need to persist.

Callout: the message applies to one section.

StatusBar: the state belongs in a persistent application bar.

Props

Banner extends HTMLAttributes<HTMLDivElement>.

BannerProps props
PropTypeDefaultDescription
toneBannerTone"warn"Tone name or alias. Canonical names are neutral, primary, info, ok, warn, and err.
titleReactNode—The condition in a few words. Adding it stacks the banner; the body then explains.
childrenReactNode—Message content. Renders as one line when title is omitted.
metaReactNode—Secondary content after the message.
actionsReactNode—Buttons or links at the trailing edge.
iconReactNode | null—Replaces the tone icon. Pass null to hide the icon.
onDismiss() => void—Shows a close button and calls this on click.
dismissLabelstring"Dismiss"Accessible name for the close button.
flushboolean—Removes the corner radius and side borders.

Banner defaults to role="status", which creates a polite live region. Set role="alert" when the message requires an interrupting announcement.

Examples

Tones

Tone shows in three places: the tint, the border, and the icon. This matches Callout. The component uses the full tone scale, not a banner-specific set.

Banner tones

Title and body

A message on its own stays one line. Adding a title stacks the title above the body within the same component, so no swap to a different component is needed when a condition needs explaining.

Banner with title

With meta

Banner with meta

With actions

Banner with actions

Dismissible

Offer dismissal only for conditions the reader can reasonably choose to stop seeing. A banner about a read-only environment or an active incident should not offer a close button.

Banner (dismissible)

Flush

When a banner is pinned under app chrome, use flush to drop the radius and side borders so it meets both edges of the window.

Banner (flush)

Custom icon

Banner icons
ImportTSX
import { Banner } from "@solarius/onset";
import type { BannerTone } from "@solarius/onset";

<Banner tone="warn" meta="Incident #1042">
  Degraded performance on the primary cluster
</Banner>

<Banner
  flush
  tone="err"
  title="Primary region unreachable"
  actions={<Button size="sm">Status page</Button>}
  onDismiss={() => setShown(false)}
>
  Requests are being served from eu-west-1.
</Banner>