System banner
A site-wide announcement bar for maintenance windows and incidents. Renders above the Topbar: one line, one action.
Purpose
The banner is for things affecting everyone — planned downtime, a live incident. Anything specific to one person or one record belongs in an Alert on the relevant page.
Tones
Four tones, each with its own glyph: info (the default), warning, destructive and
success.
A new claims portal launches next month — no action needed yet.
Scheduled maintenance this Sunday, 02:00–04:00 MYT — the portal will be unavailable. See details
We are investigating delays in claim submissions. Status page
The earlier submission delays are resolved. Thank you for your patience.
Dismissible
Pass onDismiss to show a close button. The component only reports the dismissal — it
does not hide itself — so the caller owns the state, and can persist the choice so the
banner stays gone across navigation:
import { SystemBanner } from "@healthmetrics/ui/system-banner";
function MaintenanceNotice() {
const [dismissed, setDismissed] = React.useState(false);
if (dismissed) return null;
return (
<SystemBanner tone="warning" onDismiss={() => setDismissed(true)}>
Scheduled maintenance this Sunday, 02:00–04:00 MYT.
</SystemBanner>
);
}Only planned notices should be dismissible — a live incident banner should stay until the incident does.
Structure
| Property | Value |
|---|---|
| Width | full-bleed bar; content centred at max 1280px (max-w-7xl) |
| Padding | 10px vertical (py-2.5), 16px horizontal (24px from sm) |
| Typography | 14px / Inter 500 (text-sm font-medium) |
| Fill | tone subtle background with tone ink (bg-warning-subtle / text-warning-text …) |
| Icon | 18px tone glyph |
| Action | inline link, underlined with 4px offset |
| Dismiss | 16px close glyph, 2px focus ring in the current tone colour |
| Border | none — an edge-to-edge bar, no radius |
Best practices
Do
- Render it above the Topbar so it pushes content down rather than covering it.
- Keep it to one line and at most one action — link out for the detail.
- Match the tone to the situation:
warningfor planned windows,destructivefor live incidents,successto confirm resolution. - Persist a dismissal so the banner does not reappear on every navigation.
Don't
- Show more than one banner at a time — the worst news wins.
- Use it for anything personal or record-specific — that is an Alert's job.
- Make a live incident dismissible — it should leave when the incident does.
- Use it for promotion or marketing; it reads as an emergency channel.
Accessibility & keyboard
- The wrapper deliberately renders
role="status"— a polite live region. A banner mounted mid-session (an incident starting) is announced at the next pause without interrupting; one present at page load is simply read in document order. - It is deliberately not
role="alert": a site-wide notice is ambient context, not an interruption — urgency is carried by thedestructivetone, not by hijacking the screen reader. - The dismiss button carries
aria-label="Dismiss announcement"and a visible 2px focus ring in the current tone colour. - Tone is never colour-only: each pairs a glyph with the written message.
- Keyboard: the action link and dismiss button sit in the normal Tab order; Enter activates either.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
tone | "info" | "warning" | "destructive" | "success" | undefined | "info" | Tone of the announcement. |
action | { label: string; href: string; } | undefined | — | Optional action link rendered after the message. |
onDismiss | (() => void) | undefined | — | Show a dismiss button; called when the user dismisses. |