Skip to content
Protocore Design Systemv1.6.9

/// Feedback

Banner

A full-width tinted notice band for page- or section-level status, with optional action and dismiss.

import { Banner } from "@protocore/pds";
View as Markdown

Basics

A tone, a title, and body copy as children. It spans the full width of its container — mount it at the top of a page or section.

Scheduled maintenance
The indexer will be read-only on Sunday 04:00–05:00 UTC.

Tones

Each status tone sets the tint and left rule. Add a leading icon to reinforce urgent tones like danger.

Upgrade complete
All validators are running protocol v2.4.
Consensus stalled
The network has not finalised a block in 3 epochs.

Action and dismiss

Pass an action for the one thing the user can do about it, and set dismissible (or pass onDismiss) to let them close it. The Banner manages its own open state.

Unclaimed rewards
You have staking rewards that expire at the end of the epoch.

When to use it

Use a Banner for a persistent, surface-wide condition the user should notice but that doesn't block them: scheduled maintenance, a degraded region, unclaimed rewards, a trial about to expire.

  • Loading the surface *failed* and there's nothing to show? That's an ErrorState, which replaces the content rather than sitting above it.
  • Tied to a single field or row? Use an InlineMessage.
  • A note in the reading flow? Use a Callout.
  • A fleeting confirmation of an action? Use a Toast.

Keep banners rare — a page stacked with them trains users to ignore all of them.

Usage

Do

  • Use it for persistent, page- or section-level conditions.
  • Give it a single, clear `action` when there's something to do.
  • Make it `dismissible` when the notice is non-critical.
  • Add a leading icon to reinforce urgent tones.

Don't

  • Stack several banners — collapse them or prioritize one.
  • Use a Banner for transient action feedback — that's a Toast.
  • Make a blocking error dismissible, hiding the problem.
  • Bury a critical, non-dismissible condition below the fold.

Accessibility

KeysAction
TabReaches the action control, then the dismiss (×) button, when present.
Enter / SpaceActivates the focused action or dismiss button.
  • The root is `role="status"` (polite live region) — appropriate for informational notices; it isn't announced assertively.
  • For a blocking, must-read error, prefer an ErrorState (`role="alert"`) over a Banner.
  • The dismiss button has an accessible label (`dismissLabel`, default "Dismiss") since its glyph is a bare ×.
  • The leading `icon` is decorative and `aria-hidden`; the title and body carry the message.

Banner props

PropTypeDefaultDescription
actionReactNodeTrailing action slot (e.g. a Button).
childrenReactNodeBody copy (also accepted via `children`).
classNamestring
dismissiblebooleanfalseShow a dismiss (×) button.
dismissLabelstringDismissAccessible label for the dismiss button.
iconReactNodeOptional leading icon.
onDismiss(() => void)Called when the banner is dismissed; its presence also shows the × button.
styleCSSProperties
titleReactNodeBold headline line.
toneenuminfoStatus tone; drives the tint background and left rule.

Related

  • CalloutA tone-tinted note with a 2px left rule — the one place a note earns color, over an optional mono uppercase title.
  • InlineMessageA compact single-line status message — tone dot plus text — for field- and form-level feedback.
  • ToastAn imperative notification queue — mount PdsToastProvider, raise toasts anywhere via useToast().