Skip to content
OAIT Design System

Design system / Components

Banner

One inline notice in five tones that stays in the page until its cause goes away; it also covers the form error summary and the full-width page strip for demo, practice, and staging screens.

When to use

  • A failure the person must read before going on, above the main button: "That email or password isn’t right." (error, after the attempt) (canonical §10.4, §10.22).
  • A problem that blocks the page, with who can help: "This link has expired. Ask the ID office for a new one." (warning, link_off) (D-BCP-20).
  • A condition the person can fix: "Your phone’s clock is off. Set it to automatic time." (warning, schedule).
  • What will happen next: "We email the invitation to name@example.com." (info).
  • A success worth keeping on screen, with a title: "Your email is confirmed" (success).
  • An honesty notice: "Demo data: this listing is sample content for testing the platform." (neutral) (D-BCP-23).
  • The form error summary on forms of more than five fields when two or more fields fail (canonical §10.4, §13).
  • The page strip on every page of a demo, practice, or staging mode, and on a private host screen (canonical §10.22, §11 row 10).

When not to use

Situation Use instead
A confirmation that can go by itself ("Mobile number saved") A snackbar
One field is empty or wrong The field's error line under the field (text field); the banner only summarizes
A question or a destructive confirmation A dialog
An unbuilt feature "Coming soon" with a warning status chip or status dot, one sentence, no action (canonical §12.5)
The status of a person, pass, or row A status chip or a status indicator
Nothing to show in a list or table An empty state
A cookie banner None: the family sets no non-essential cookies. If one is ever required, a neutral page banner with equal "Accept" and "Reject" buttons, nothing pre-ticked (D-CSN-41)

Anatomy

  1. Container: the tone's container fill, 16px corners, 12px 16px padding, a transparent 1px edge, no visible edge (.oa-banner).
  2. Icon: 20px, filled, in the tone's on-color, centered on the first line (.oa-banner__icon).
  3. Content (.oa-banner__content):
    1. Title (optional): a short label in label-md (.oa-banner__title) (D-ARC-20).
    2. Message: one or two sentences in body-md (.oa-banner__message).
    3. Field links (error summary only): one standalone link per invalid field (.oa-banner__list).
    4. Actions (optional): text buttons (.oa-banner__action) or links, under the message (.oa-banner__actions).
  4. Close button (optional, dismissible banners only): 48px, at the inline end (.oa-banner__close).

The page strip has its own anatomy: a full-width bar (.oa-page-strip), a chip (.oa-page-strip__chip) and one line of text.

Variants

Tone Use for Container / text Icon
Info What will happen, guidance, a passkey note, or a verification note bg-info-container text-on-info-container info
Success A result worth keeping on screen bg-success-container text-on-success-container check_circle
Warning A problem the person can fix or a limit: a clock, a link, a deadline bg-warning-container text-on-warning-container warning, or the message's own schedule or link_off
Error A failure: a sign-in error, a request that was not sent, an import that stopped bg-error-container text-on-error-container error
Neutral Notes that are neither good nor bad: demo data, a sample bg-surface-container-high text-on-surface info

Status families come from canonical §2.3; every tone shows an icon and words, never color alone. Peach and burgundy fills never carry status (D-CSN-26, D-COL-07 to D-COL-10).

Form error summary

An error banner with a title, the sentence "Check the highlighted fields." and one link per invalid field. It takes focus when the form is submitted (tabindex="-1"). Each link's text is that field's error message and its target is the field (canonical §10.4, §13; D-CSN-26).

Page strip

A full-width notice directly under the header for environments that are not live: DEMO, practice, staging. No corners, 8px 16px padding, text centered, the info tone, with a "DEMO" chip in the strip's colors reversed. The private host screen (keep it off the projector) uses the warning tone (canonical §10.22, §11 row 10).

Strip Use for Tokens
.oa-page-strip Demo, practice, and staging pages --color-info-container, --color-on-info-container; chip reversed
.oa-page-strip--warning The private host screen --color-warning-container, --color-on-warning-container; chip reversed

The reversed chip follows Games' safety bar, whose DEMO pill swaps the bar's container and on-colors; the pair keeps its declared contrast (13.17:1 light and 7.22:1 dark on info, 13.25:1 and 7.22:1 on warning). The sources name only "a DEMO chip", so the reversal is this page's choice.

Sizes

Size Height Padding Type style Icon size
Banner from its content; one line is 46px with the 1px edges 12px 16px (px-4 py-3) message body-md; title label-md 20px (--size-icon-md)
Page strip from its content; one line is 42px (the 24px chip sets the line) 8px 16px (px-4 py-2) body-md; chip label-sm on a 24px pill none

Inside the banner: actions are 40px text buttons whose hit area reaches 48px; summary links are 48px standalone links; the close button is 48 × 48px. The banner is as wide as its column.

Tokens

Part Property Token
Banner corners --radius-box (16px, rounded-box)
Banner padding, gap --space-3 block and gap (12px), --space-4 inline (16px)
Banner edge 1px solid transparent (drawn only in forced colors)
Banner fill / text the tone's --color-<tone>-container / --color-on-<tone>-container; neutral --color-surface-container-high / --color-on-surface
Banner type --text-body-md and its companions
Icon size, fill --size-icon-md (20px), FILL 1 (.oa-icon--filled)
Title type --text-label-md
Content gap --space-1 (4px) between title, message, links, and actions
Links color --oa-link set to currentColor: the banner's on-color, underlined; never --color-primary-ink
Action box, type --size-button-sm (40px), --space-5 (20px) inline padding, --radius-full, --text-label-md, the on-color
Action, close state layer currentColor at --opacity-state-hover and --opacity-state-pressed, over --duration-short-3 with --ease-standard, covering the 1px edge
Action, loading spinner arc currentColor, track transparent, --size-icon-sm (18px), 2px stroke
Close box --size-touch-target (48px), --radius-full
Page strip fill / text --color-info-container / --color-on-info-container; warning: --color-warning-container / --color-on-warning-container
Page strip padding, gap --space-2 block (8px), --space-4 inline (16px); gap --space-1 by --space-3
Strip chip box 24px (--space-6) tall, --space-3 inline padding, --radius-chip, --text-label-sm

States

State What changes
At rest The banner is not interactive. Links are underlined in the on-color; actions show their label only.
Hover Links: the underline thickens to 2px. Actions and close: a layer of the on-color at --opacity-state-hover (8%).
Focus-visible The family ring in --color-focus-ring (primary-ink, 5.45:1 or more on every container, canonical §2.8). The error summary shows the ring on its 16px corners when it takes focus after a keyboard submit (after a click, browsers may leave the ring off; the summary is still read).
Pressed The layer at --opacity-state-pressed (12%) at once.
Disabled Not used: an action that cannot run is not shown.
Loading A retry action shows the button loading state: [aria-busy="true"] with [aria-disabled="true"], no state layer, waiting words ending in "…" ("Sending…"), and an 18px spinner (the small button's icon size) whose arc takes the label color with no track (D-CAI-06); see button.
Dismissed The banner leaves the page; the dismissal is remembered for the session (D-CSN-26).

Behavior

  • Placement. In the flow of the page, as wide as its column. A failure of the form's action sits above the main button; page notices sit at the top of <main>; the error summary sits at the top of the form; the page strip sits directly under the header, full width (canonical §10.4, §11).
  • Live roles. Only a banner that appears after an action has a live role: role="alert" for an error, role="status" for the other tones. A banner present when the page loads has none (canonical §10.22). A polite region added to the page together with its words is not read reliably, so render a role="status" banner inside a wrapper that carries the role from page load, as the snackbar host does; an error banner with role="alert" is read when it is inserted.
  • Error summary. On a submit with two or more errors in a form of more than five fields, render the summary at the top of the form, then move focus to it. Its links point to the fields (href="#field-id"); following one moves focus into the field. Fields keep their own error lines ([aria-invalid="true"] and [aria-describedby] on the field). Every submit applies the same rule: the summary is rebuilt, and it goes when fewer than two fields fail. Shorter forms, and a single error in a longer form, focus the first invalid field instead (canonical §10.4, §13).
  • Dismissal. Dismissible banners are notes the person may ignore, such as an info or success note; a banner whose cause still applies stays until the cause goes. Closing removes the banner for the session (D-CSN-26). If the close button had focus, move focus to the next focusable element after the banner, or to the heading of its section (tabindex="-1"), so focus is never lost; the sources do not say where focus goes, so this follows WCAG 2.4.3 (focus order).
  • Actions. A text button acts in place ("Try again"); a link goes somewhere ("Contact us"). Actions sit under the message and wrap on narrow widths.
  • Motion. None: a banner is part of the page flow, so it appears and leaves without a transition.
  • Page strip. Present on every page of the mode, never dismissible, no live role. Its text wraps and stays centered; the chip leads.

Accessibility

  • Element. A div (the summary: a div with an h2 title, named through [aria-labelledby]); live roles only as above (canonical §13).
  • Not by color alone. Every tone has its icon and words; the icon is hidden from screen readers ([aria-hidden="true"]) and the words name the problem (canonical §2.3).
  • Contrast. Text on every container is 13.12:1 or more in light and 7.22:1 or more in dark (D-CSN-26; on-info-container 13.17:1, on-success-container 13.12:1, on-warning-container 13.25:1, on-error-container 13.26:1 in light); neutral text on surface-container-high 13.2:1 or more in light and 9:1 or more in dark. Links use the same on-color with an underline, which removes the 3.82–4.02:1 failures of orange links on these containers (D-CSN-26).
  • Keyboard. Tab reaches the links, actions, and close button in order. The summary receives focus on submit; its links move focus to their fields.
  • Targets. Actions reach 48px through their hit area, summary links are 48px standalone links, the close button is 48 × 48px. Links inside a sentence are exempt.
  • Forced colors. The transparent 1px edge becomes the banner's outline; icons are currentColor.
  • Reduced motion. Nothing moves.

RTL and languages

  • The icon sits at the inline start (right in Arabic), the close button at the inline end; actions start at the inline start of their row. Status glyphs, schedule, and link_off never mirror (canonical §8.3).
  • Arabic body text is 14px with a 1.75 line height; the icon stays centered on the first line in every language (--oa-banner-line measures the line).
  • French runs about 26% longer overall, up to 32% for short labels, and wraps: "Ce lien a expiré. Demandez-en un nouveau au Bureau de l’identité et des accès." Never truncate a banner.
  • Emails, URLs, and codes inside Arabic messages sit in <bdi dir="ltr"> (canonical §14.2).
  • The page strip's chip may be a word in the page language ("لوحة المقدّم الخاصة") or the Latin "DEMO"; tag a Latin chip on an Arabic page with lang="en".

Content

  • What happened, then what to do; who helps when the person cannot: "This link doesn’t work. Ask the ID office for a new one." (D-BCP-20, canonical §12.4).
  • A system failure names a fallback channel: "Your request couldn’t be sent. Try again, or email us at info@oait.app."
  • A title is a short label without a full stop ("Your email is confirmed"); messages are sentences with full stops; two sentences at most.
  • Error summary: the title says what failed ("Your message was not sent"), the message is "Check the highlighted fields.", and each link repeats its field's error ("Choose what your message is about.").
  • Page strip: "Practice only · {what is fictional} · {what does not change}" after the "DEMO" chip (canonical §11 row 10).
  • Never "please", "invalid", "oops", blame, or humor; codes come last (canonical §12.4).
English Arabic French
This link has expired. Ask the ID office for a new one. انتهت صلاحية هذا الرابط. اطلب رابطًا جديدًا من مكتب الهوية والوصول. Ce lien a expiré. Demandez-en un nouveau au Bureau de l’identité et des accès.
Your phone’s clock is off. Set it to automatic time. ساعة هاتفك غير مضبوطة. اضبطها على الوقت التلقائي. L’horloge de votre téléphone n’est pas à l’heure. Réglez-la sur l’heure automatique.
Your email is confirmed تم تأكيد بريدك الإلكتروني Votre adresse e-mail est confirmée
We email the invitation to {email}. نرسل الدعوة بالبريد الإلكتروني إلى {email}. Nous envoyons l’invitation par e-mail à {email}.
The import stopped before the end. Try again to carry on from where it stopped. توقّف الاستيراد قبل نهايته. حاول مجددًا لمتابعته من حيث توقّف. L’importation s’est arrêtée avant la fin. Réessayez pour reprendre là où elle s’est arrêtée.
Keep this screen off the projector. Answer keys and controls are private. لا تعرض هذه الشاشة على جهاز العرض. الإجابات وعناصر التحكم خاصة. —

The Global ID and Games strings ship today. The apostrophes follow canonical §3.7 and §12.2, and the Arabic tanween sits on the letter before the alif ("رابطًا جديدًا", "مجددًا", canonical §12.6), where Global ID writes "رابطاً جديداً" and "مجدداً" today, a migration item for native review.

Do and don't

Do Don't
Put the server's sign-in error in an error banner above "Sign in", announced with role="alert" Show it in a snackbar that goes after 6 seconds
Give links inside a banner the banner's on-color with an underline Color them primary-ink or orange
Pick the tone by meaning: warning for the clock, error for a failure Use peach or burgundy fills for status, or color without an icon
Focus the error summary on submit and link each error to its field List errors without links, or make the summary the only error signal
Show the page strip on every page of a demo Hide "DEMO" in the footer, or let the strip be closed
Keep the banner flat in its column Add an edge, a colored start rule, or a shadow

Code

HTML (reference CSS)

Error after an action:

<div class="oa-banner oa-banner--error" role="alert">
  <span class="oa-icon oa-icon--md oa-icon--filled oa-banner__icon" aria-hidden="true" translate="no">error</span>
  <div class="oa-banner__content">
    <p class="oa-banner__message">That email or password isn’t right.</p>
  </div>
</div>

Success with a title, dismissible:

<div class="oa-banner oa-banner--success">
  <span class="oa-icon oa-icon--md oa-icon--filled oa-banner__icon" aria-hidden="true" translate="no">check_circle</span>
  <div class="oa-banner__content">
    <p class="oa-banner__title">Your email is confirmed</p>
    <p class="oa-banner__message">Thank you. Global ID can now use it to help you get back in.</p>
  </div>
  <button type="button" class="oa-banner__close" aria-label="Close message"><span class="oa-icon" aria-hidden="true" translate="no">close</span></button>
</div>

A link and an action:

<div class="oa-banner oa-banner--error">
  <span class="oa-icon oa-icon--md oa-icon--filled oa-banner__icon" aria-hidden="true" translate="no">error</span>
  <div class="oa-banner__content">
    <p class="oa-banner__message">Your request couldn’t be sent. Try again, or email us at <a class="oa-link" href="mailto:info@oait.app">info@oait.app</a>.</p>
    <div class="oa-banner__actions">
      <button type="button" class="oa-banner__action">Try again</button>
    </div>
  </div>
</div>

Form error summary:

<div class="oa-banner oa-banner--error" role="alert" tabindex="-1" aria-labelledby="fb-summary-title">
  <span class="oa-icon oa-icon--md oa-icon--filled oa-banner__icon" aria-hidden="true" translate="no">error</span>
  <div class="oa-banner__content">
    <h2 id="fb-summary-title" class="oa-banner__title">Your message was not sent</h2>
    <p class="oa-banner__message">Check the highlighted fields.</p>
    <ul class="oa-banner__list">
      <li><a class="oa-link oa-link--standalone" href="#fb-contact-topic"><span class="oa-link__label">Choose what your message is about.</span></a></li>
      <li><a class="oa-link oa-link--standalone" href="#fb-contact-reply"><span class="oa-link__label">Enter your email or phone number so we can reply.</span></a></li>
      <li><a class="oa-link oa-link--standalone" href="#fb-contact-message"><span class="oa-link__label">Write your message (up to 4,000 characters).</span></a></li>
    </ul>
  </div>
</div>

Page strips:

<div class="oa-page-strip">
  <span class="oa-page-strip__chip">DEMO</span>
  <span>Practice only · Fictional visitors · No real scores or Global ID changes</span>
</div>
<div class="oa-page-strip oa-page-strip--warning">
  <span class="oa-page-strip__chip">Private host desk</span>
  <span>Keep this screen off the projector. Answer keys and controls are private.</span>
</div>

Every tone and state, and the Arabic examples, are in reference/snippets/feedback.html.

Tailwind CSS v4

<div role="alert" className="flex w-full items-start gap-3 rounded-box border border-transparent bg-error-container px-4 py-3 text-body-md text-on-error-container [--oa-link:currentColor]">
  <span className="flex h-lh shrink-0 items-center">
    <Icon name="error" size={20} filled />
  </span>
  <div className="flex min-w-0 flex-1 flex-col items-start gap-1">
    <p className="text-pretty">Your request couldn’t be sent. Try again, or email us at <a className="font-semibold text-current underline underline-offset-4 hover:decoration-2" href="mailto:info@oait.app">info@oait.app</a>.</p>
    <div className="mt-1 flex flex-wrap items-center gap-2">
      <button
        type="button"
        className="relative isolate inline-flex h-10 shrink-0 items-center rounded-full border border-transparent px-5 text-label-md text-current before:absolute before:-inset-px before:-z-1 before:rounded-[inherit] before:bg-current before:opacity-0 before:transition-opacity before:duration-short-3 before:ease-standard after:absolute after:inset-x-0 after:-inset-y-[5px] hover:before:opacity-(--opacity-state-hover) active:before:opacity-(--opacity-state-pressed) active:before:transition-none"
      >
        Try again
      </button>
    </div>
  </div>
</div>

A title goes first in the content column as a text-label-md paragraph or heading. Swap bg-error-container text-on-error-container for bg-info-container text-on-info-container, bg-success-container text-on-success-container, bg-warning-container text-on-warning-container, or bg-surface-container-high text-on-surface. The h-lh wrapper is one line of the message tall, so the icon centers on the first line in every language.

A dismissible banner ends with its close button, after the content column:

<button
  type="button"
  aria-label="Close message"
  className="relative isolate -my-3 -me-3 inline-flex size-12 shrink-0 items-center justify-center rounded-full border border-transparent text-current before:absolute before:-inset-px before:-z-1 before:rounded-[inherit] before:bg-current before:opacity-0 before:transition-opacity before:duration-short-3 before:ease-standard hover:before:opacity-(--opacity-state-hover) active:before:opacity-(--opacity-state-pressed) active:before:transition-none"
>
  <Icon name="close" size={24} />
</button>

The error summary lists its links in <ul className="flex flex-col items-start">, each <a className="inline-flex min-h-12 items-center rounded-full font-semibold text-current underline underline-offset-4 hover:decoration-2">.

Page strip:

<div className="flex w-full flex-wrap items-center justify-center gap-x-3 gap-y-1 border-y border-transparent bg-info-container px-4 py-2 text-center text-body-md text-on-info-container">
  <span className="inline-flex h-6 items-center whitespace-nowrap rounded-chip bg-on-info-container px-3 text-label-sm text-info-container">DEMO</span>
  <span>Practice only · Fictional visitors · No real scores or Global ID changes</span>
</div>

shadcn/ui: restyle Alert to the tones (no border, rounded-box, a 20px filled icon, on-color links); its default variant maps to neutral and destructive to error.

React

Prop Type Default Description
tone "info" | "success" | "warning" | "error" | "neutral" "neutral" Container, text color, and default icon.
icon string the tone's A Material Symbols name for the message's own icon (schedule, link_off).
title ReactNode — Optional short label above the message.
children ReactNode — The message: one or two sentences.
actions ReactNode — Text buttons (BannerAction) or links, shown under the message.
announce boolean false Set when the banner appears after an action: role="alert" for error, role="status" otherwise.
onClose () => void — Makes the banner dismissible and shows the close button.
closeLabel string — The close button's name, translated ("Close message"). Required with onClose.

ErrorSummary takes title, errors: { fieldId: string; message: string }[] and a ref to focus on submit. PageStrip takes tone ("info" or "warning"), chip and children.

{signInError ? (
  <Banner tone="error" announce>
    That email or password isn’t right.
  </Banner>
) : null}
<Button variant="filled" size="lg" type="submit">Sign in</Button>