Feedback and status
Which message a product shows for which event, where it sits, how long it stays, and how it reaches a screen reader: snackbars, banners, field errors, inline status, status indicators, confirm dialogs, progress, and waiting.
| Template | A cross-template pattern: every one of the eleven templates uses it (canonical §10.21–§10.24, §12.4, §13) |
| Used by | Every product |
| Reference | The feedback section of the kitchen sink and reference/snippets/feedback.html; reference/templates/settings.html shows the snackbar with Undo |
| Decisions | D-CSN-21, D-CSN-25, D-CSN-26, D-CSN-27, D-CSN-28, D-CSN-29, D-CSN-30, D-CAI-06, D-CAI-10, D-CAI-18, D-BCP-20, D-BCP-23, D-BCP-25, D-ARC-08 |
Purpose
- Give every event one container, so the same news looks and sounds the same in every product: a saved change is always a snackbar, a wrong field always an error under it (D-CSN-25, D-CAI-10).
- Reach every person: words and icons, never color alone; live regions that exist from load; focus moved only when the person must act (canonical §13).
- Keep waits calm and honest: the content stays, a spinner always has words, and progress says how far (D-CSN-28, D-CSN-29).
When to use
Every time a product tells a person what happened, what is happening now, or what state something is in. Pick the container from the table below before writing the words; the words follow Content.
Use something else when you are choosing a whole page's layout: the eleven templates are in the patterns index; a page that cannot be shown at all is empty, error, and offline.
Which feedback for which event
| Event | Container | Where | Reaches screen readers by | Stays | Example |
|---|---|---|---|---|---|
| A change the person made is saved, and can be reversed | Snackbar with "Undo" | Bottom of the window, inline start | The page's status region (the snackbar host) | 10 s (--duration-dwell-snackbar-action), paused on hover and focus |
"Mobile number saved" · "Undo" → "Change undone" |
| Something is done; nothing to act on | Snackbar | Same | Same | 6 s (--duration-dwell-snackbar) |
"Signed out of {device}", "Passkey added" |
| A background action failed, and nothing is blocked | Snackbar with "Try again" | Same | Same | 10 s | "We couldn't change the language. Try again." |
| A new version is ready | Snackbar with "Reload" | Same | Same | 10 s | "A new version is ready" · "Reload" |
| A field is wrong after a submit | Field error under the field | In the form | Focus moves to the first invalid field; the error is its description | Until fixed | "Enter an email address, like name@example.com." |
| Two or more errors in a form of more than five fields | Error summary: an error banner with a title and links | Top of the form | Focus moves to it | Until fewer than two fields fail | "Your message was not sent" · "Check the highlighted fields." |
| A submit failed for a reason no field owns | Error banner | Above the main button (in the sign-in card, under its intro) | role="alert" |
Until the next submit | "That email or password isn't right.", "Too many tries. Wait a minute and try again." |
| The person cannot do this here | Warning banner that says who helps; a full-page state when nothing else on the page works | In place | role="status" when it appears after an action |
While it applies | "This link doesn't work. Ask the ID office for a new one." |
| The outcome is not known (the connection dropped mid-action) | Warning banner | Where the action was | role="status" |
Until the next action | "Connection interrupted. Nothing new has been confirmed." |
| A condition that lasts on this page | Banner present at load | Top of main or of its section |
No live role | While it lasts; info and success notes may be dismissed for the session | "Demo data: this listing is sample content for testing the platform." |
| A whole mode is not real (demo, practice, staging) | Page strip with a "DEMO" chip (banner) | Full width under the header, every page of the mode | No live role | Never dismissible | "Practice only · Fictional visitors · No real scores or Global ID changes" |
| The state of a record | Status chip | In the row, cell, or card | Its words | As long as the state | "Active", "Invited", "Pending activation", "Suspended" |
| A fact with a status meaning | Inline status: a filled 16px icon and words | Beside the thing | Its words | As long as true | "Verified employer", "Closes in 4 days" |
| Something is live right now | Status indicator, large, pulsing only while live | Before the heading or line | Its words; the dot is hidden | While live | "Ready to scan" |
| A copy or other instant action on the control itself | The assist chip's label and icon change | On the chip | A polite live region | 2.4 s (--duration-dwell-confirm) |
"Copy address" → "Address copied" |
| A decision with consequences | Confirm dialog (role="alertdialog") |
Modal | Focus moves to Cancel | Until answered | "Sign out of {device}?" |
| The number of results changes | The count in the h1, and one polite sentence | The heading and a status region | The page's status region, or a status line present from load | Until the next change | "15 jobs match these filters." |
| Nothing to show | Empty state | Where the content would be | Its heading and words | Until there is content | "No jobs for “sales manager”" |
| The page cannot be shown (missing, failed, offline) | Full-page state | Inside the product's shell | The h1 and the document title | Until the person leaves or retries | See empty, error, and offline |
| A session is about to end | A basic dialog that offers more time | Modal | Focus moves to its main button | Until answered or the time runs out | — |
Sources: canonical §10.4, §10.9, §10.19, §10.21–§10.24, §11 rows 4 and 10, §12.4, and §13; D-CSN-25, D-CSN-26, D-CAI-18. Canonical §13 asks sessions to warn before ending and gives no container; the basic dialog is this page's choice, because the person must answer within a time limit (WCAG 2.2.1).
Never
- A snackbar for validation or for a blocking error: it goes by itself, and people miss it (D-CSN-25).
- A toast without a role, or a second toast system: the snackbar is the family's only transient message (canonical §10.21, §13).
role="alert"for something that is not blocking; field messages as live regions (D-CAI-10).- A dialog to say something succeeded; a dialog with "OK".
- Status by color alone: every status shows an icon and words (canonical §2.3).
- Icons, colored edges, or titles on a snackbar (D-CSN-25).
Structure
Desktop (from 1024px)
Where each container sits, top to bottom, on any template:
- Page strip under the header, for a mode that is not real ("DEMO", practice, staging); the private host screen uses the warning tone (demo and training).
- Notices at the top of
main: banners present at load ("Add an emergency contact", "Demo data: …"). - Content with its status chips, inline statuses, and status indicators next to the things they describe.
- Forms: the error summary at the top of a long form; field errors under their fields; the error banner above the main button; the reassurance line under it.
- Snackbar host, fixed at the bottom: 16px gutters below 768px, 24px from the inline start from 768px, up to 600px wide, 16px above any bottom bar (
calc(6rem + env(safe-area-inset-bottom))above the navigation bar), on--z-snackbar(60), above dialogs (canonical §10.21, §4.9). - Dialogs and sheets for confirmations, on
--z-modal(50): a dialog from 768px, a bottom sheet below (canonical §10.19).
Phone (below 640px)
- The snackbar spans the window minus 16px gutters, 16px above the bottom edge and the safe-area inset, or above the navigation bar (canonical §10.21).
- Confirmations open as bottom sheets below 768px, with Cancel and the verb sharing the width at 56px (canonical §10.19).
- Banners take the full width of their column; their actions wrap under the message. The page strip wraps onto two or three centered lines.
In between (640–1023px)
- From 768px confirmations open as dialogs, and the snackbar sits 24px from the inline start, up to 600px wide (canonical §10.19, §10.21).
Skeleton
Where the containers sit in the DOM. The markup of each one is on its component page (banner, snackbar, text field). The reassurance line takes .oa-supporting from base.css, the on-surface-variant color (Tailwind: text-on-surface-variant).
<a class="oa-skip-link" href="#main">Skip to content</a>
<header class="oa-site-header"><!-- the product's header --></header>
<!-- only on the pages of a mode that is not real (demo, practice, staging): -->
<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>
<main id="main" tabindex="-1" class="oa-container oa-container--form oa-stack oa-stack--loose">
<h1 class="oa-page-title">Contact us</h1>
<form class="oa-stack oa-stack--fields" novalidate>
<!-- the error summary: a form of more than five fields with two or more errors (canonical §10.4) -->
<div class="oa-banner oa-banner--error" role="alert" tabindex="-1" aria-labelledby="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="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="#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="#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="#contact-message"><span class="oa-link__label">Write your message (up to 4,000 characters).</span></a></li>
</ul>
</div>
</div>
<!-- the fields, each with its error line under the box: the topic choice cards (#contact-topic), Email (#contact-reply), Your message (#contact-message) -->
<button class="oa-btn oa-btn--filled oa-btn--lg oa-btn--wide" type="submit">Send message</button>
<p class="oa-text-body-md oa-supporting">We keep your message and contact details to answer you, and delete them 3 years after we have dealt with them.</p>
</form>
</main>
<footer class="oa-footer"><!-- the product's footer --></footer>
<div class="oa-snackbar-host" role="status" aria-live="polite"></div>Components used
| Event family | Component | Classes |
|---|---|---|
| Transient confirmations | Snackbar | .oa-snackbar-host, .oa-snackbar |
| Inline notices, form summary, page strip | Banner | .oa-banner (+ tones), .oa-page-strip |
| Field errors | Text field, checkbox, radio, and switch | .oa-field__error, .oa-fieldset |
| States of things | Chip (status chips, inline status), status indicator | .oa-status-chip, .oa-inline-status, .oa-status |
| Waiting | Progress, skeleton, button (loading) | .oa-progress, .oa-spinner, .oa-skeleton |
| Decisions | Dialog, bottom sheet | .oa-dialog, .oa-modal |
| Nothing to show, page problems | Empty state | .oa-empty, .oa-state-page |
Waiting and progress
| Wait | Show | Decision |
|---|---|---|
| Under 1 second | Keep the content and set [aria-busy="true"] on the region; nothing spins yet |
canonical §10.23, D-CSN-29 |
| 1–10 seconds, an action | A 20px spinner in the button with the progress label ("Saving…"), or a 48px spinner with words where the content will appear ("Getting your scan code…") | canonical §10.23, D-CAI-06 |
| Over 1 second, content with a known layout | Skeleton blocks in the final layout; the region [aria-busy="true"] with one hidden "Loading {thing}…" |
canonical §10.23 |
| The amount is known | A linear progress bar, with the value also in words: "Profile 80% complete" (Global ID), "Answered: 12 of 120" (Tamakkan) | D-CSN-28 |
| Over 10 seconds | Determinate progress with words when the amount is known; otherwise the spinner and words that say which step is running ("Reading the file…", "Checking…", "Importing…") | This page's choice: canonical names no band above 10 seconds |
- Loading keeps colors and focus. A busy button keeps its fill, gets
[aria-busy="true"]and[aria-disabled="true"], locks its width, and ignores further presses; it is never grayed out (D-CAI-06). - Words always. A spinner never stands alone. The progress label is a verb ending in "…": "Sending…", "Saving…", "Waiting for your device…", "Starting the camera…" (canonical §12.4).
- Colors. Progress bars and region spinners are
primary-inkonsurface-container-highest(a bar's track) oroutline-variant(a spinner's track), neverprimary, which is 2.13:1 on its track (canonical §10.23). The 20px spinner inside a button draws its arc in the label color with no track, so it stays visible on every fill (D-CAI-06). - Motion.
animate-spinnerandanimate-skeletononly while loading; neveranimate-spinoranimate-pulse(canonical §4.12). Under reduced motion the spinner stands still beside its words, skeletons are flat, and bars jump to their value (canonical §7.7).
Live regions and focus
- One page-level status region. Every page mounts the snackbar host,
<div class="oa-snackbar-host" role="status" aria-live="polite">, empty at load. A live region created when the message arrives is not announced reliably, so it is never created on demand (canonical §10.21, §13). - Counts and in-place words. A result count ("15 jobs match these filters.") and a region's waiting words are announced through a polite region that exists from load: the page's status region, or a status line of their own where the words appear, such as the bulk bar's count (canonical §10.13) or a 48px spinner's words. The region is never created when the words arrive, and a status line never repeats what the snackbar says (canonical §13).
- Alerts only for blocking errors.
role="alert"goes on the error banner after a failed submit, and on the error summary, which also takes focus (canonical §10.22, §13). - Banners present at load have no live role; banners that appear after an action are
role="alert"(error) orrole="status"(other tones) (canonical §10.22). - Focus moves to the first invalid field or the error summary after a failed submit, to the h1 after a route or step change, into a dialog when it opens, and back to its opener when it closes. A snackbar never takes focus; Tab reaches its action and close button (canonical §13, §10.21).
Content
| Kind | Rule (canonical §12.4, D-BCP-20) | Example |
|---|---|---|
| Field error | Verb first; what to do; an example when a format matters; one sentence | "Enter an email address, like name@example.com." |
| Form summary | One sentence, then a link to each field | "Check the highlighted fields." |
| Action failed | What happened, then what to do | "That email or password isn't right." |
| System failure | What happened; try again; a fallback channel | "Your request couldn't be sent. Try again, or email us at info@oait.app." |
| Uncertain outcome | What is known; nothing was confirmed | "Connection interrupted. Nothing new has been confirmed." |
| Not allowed | Why, and who helps | "This link doesn't work. Ask the ID office for a new one." |
| Empty | The state, why, one way out | "No jobs for “sales manager”" · "Try another word" · "See all jobs" |
| Success | Object + past participle; Undo when reversible | "Mobile number saved" · "Undo" → "Change undone" |
| Waiting | Verb-ing + "…" | "Sending…", "Waiting for your device…" |
| Destructive confirm | A question naming the thing; the consequence; repeat the verb | "Sign out of {device}?" · "Sign out" · "Cancel" |
| Offline | The state, then the action | "You're offline" · "Check your connection, then try again." |
| Limits | Plain and early | "Unofficial practice. Scores are estimates." |
- Never "please", "invalid", "oops", "successfully", blame, or humor. Error codes come last and small: "Error code: invalid_request". Example addresses are
name@example.com. Messages never reveal whether an account exists (canonical §12.4). - Snackbar text is one sentence, two lines at most; its action is one verb: "Undo", "Reload", "Try again" (canonical §10.21).
- Status words come from one list per product. Global ID: "Active" (
success,check_circle), "Invited" (warning,mail), "Pending activation" (warning,schedule), "Suspended" (error,block), "Expired" (neutral,event_busy); "Coming soon" (warning,schedule) (canonical §10.9). - Reassurance lines sit under an action that asks for data, money, or commitment, in
text-body-md text-on-surface-variant: "Free account · takes about a minute" (Global Jobs; canonical §12.5).
| English | Arabic | French |
|---|---|---|
| Mobile number saved | تم حفظ رقم الهاتف | Numéro de mobile enregistré |
| Change undone | تم التراجع عن التغيير | Modification annulée |
| A new version is ready · Reload | نسخة جديدة جاهزة · إعادة التحميل | Une nouvelle version est disponible · Recharger |
| Close message | إغلاق الرسالة | Fermer le message |
| 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. |
| Starting the camera… | جارٍ تشغيل الكاميرا… | Démarrage de la caméra… |
These strings ship in Global ID; waiting labels keep their single ellipsis character in every language. The tanween sits on the letter before the alif ("رابطًا جديدًا", canonical §12.6), where Global ID writes "رابطاً جديداً" today, a migration item for native review.
States
| Container | Appears | Leaves | Motion |
|---|---|---|---|
| Snackbar | When the event happens; a new one replaces the old one | After its dwell, on Close, or when its action runs | Fades in and out over --duration-short-3; nothing under reduced motion |
| Banner | When the page loads, or after the action that caused it | When its cause goes, or on Close for dismissible notes (remembered for the session) | None: it is part of the page flow |
| Page strip | On every page of the mode | Never inside the mode | None |
| Field error | On submit, then live as the field changes | When the value is valid | None |
| Assist chip confirmation | On success | After --duration-dwell-confirm (2.4 s) |
Label and icon swap at once |
| Status indicator | While the state lasts | When it changes | animate-live only while live; still under reduced motion |
| Confirm dialog | On the trigger | On Cancel, Escape, the scrim, Close, or the verb | The scrim fades in, and the dialog fades in and scales from 0.95, over --duration-short-3; both fade out over --duration-short-3 with --ease-emphasized-accelerate, or close at once in React (Radix) products (canonical §7.3) |
Accessibility
- Status messages: one polite page region, present at load; alerts only for blocking errors; toasts always have a role (WCAG 4.1.3, canonical §13).
- Errors: words and an icon,
[aria-invalid="true"]andaria-describedbyon the field; a focused summary for long forms (WCAG 3.3.1, 3.3.3). - Timing: a snackbar with an action stays 10 seconds and waits while hovered or focused; anything important also has a second path (WCAG 2.2.1, canonical §10.21).
- Not by color alone: status is tone, icon, and words; the live dot is hidden and its word speaks (WCAG 1.4.1).
- Contrast: snackbar text 11.63:1 (light) on
inverse-surface, its action ininverse-primary7.74:1, its edge inoutline5.85:1 on the dark page; banner text on its container 13:1 or more light, 7.22:1 or more dark (tokens.md, D-ARC-08). - Focus is never obscured: the snackbar host sits above any bottom bar and the sticky header keeps its scroll padding (WCAG 2.4.11).
- Reduced motion: every state still changes, at once; spinners and live dots stand still beside their words (canonical §7.7).
RTL and languages
- The snackbar sits at the inline start: bottom right in Arabic. Sonner products pass
position="bottom-right"withdir="rtl"on Arabic pages (canonical §10.21). - Banner icons sit at the inline start; their actions wrap under the message. Progress bars fill from the inline start, from the right in Arabic (canonical §14.2).
- Status icons (
check_circle,error,warning,info) never mirror;undodoes (canonical §8.3). - Waiting labels translate with their ellipsis character "…"; Arabic and French keep it (canonical §12.2).
- French runs about 26% longer overall and up to 32% for short labels: a snackbar message wraps to two lines at most, so keep it to one short sentence; check at 360px (canonical §3.7).
Do and don't
| Do | Don't |
|---|---|
| "Mobile number saved" with "Undo" in the snackbar | "Your changes were saved successfully" in a green toast with an icon |
| A field error under the field, focus on the field | A snackbar that says "Please check the form" |
An error banner with role="alert" above Sign in |
A modal "Error" dialog with "OK" |
| "Connection interrupted. Nothing new has been confirmed." | "Something went wrong" with no next step |
| A spinner with "Getting your scan code…" | A spinner alone, or "Loading..." with three dots |
| The live pulse only while the state is live | A pulsing dot as decoration |
| Mount the snackbar host at load | Create the live region when the message arrives |
Best current example
Global Jobs' job detail page (/en/jobs/…, 1440px screenshot after pressing Share) shows the decision table in one screen: a neutral notice at the top ("Demo data: this listing is sample content for testing the platform."), the inline statuses "Verified employer" and "Closes in 4 days", the reassurance line "Free account · takes about a minute" under "Apply now", and the "Link copied" toast at the bottom inline end. The toast is the part that changes: white, with an icon and a gray focus ring at 1.61:1, it becomes the family snackbar on inverse-surface, at the inline start, with no icon (JB-1.03). Global ID's sign-in error (1440px screenshot) is the model of the form-level banner: "Enter your email and your password." in an error banner under the step title, with role="alert". Global ID's SnackbarProvider (source) is the model snackbar: a polite host mounted at load, 6 s or 10 s with an action, paused on hover and focus, "Mobile number saved" with "Undo".
Reference template
No page template is dedicated to feedback; every template will use it. reference/templates/settings.html shows the snackbar with Undo after a one-field edit, and the kitchen sink shows every container in every tone.
Related
- Forms and settings: validation, error summaries, and saving.
- Empty, error, and offline: when a whole page cannot be shown.
- Demo and training: page strips for modes that are not real.
- Accessibility: status messages, focus, and timing.