Accessibility

a11y/toast-timing

Toasts with actions or information the user needs do not disappear on a timer; others stay long enough and pause on hover and focus.

moderatemanualWCAG 2.2.1, 4.1.3 · Afe-a11y-carousel-toast

Why

A toast that offers "Undo" for five seconds is gone before a screen reader user hears it and finds the button, and before a magnifier user scrolls to it. The APG has no toast pattern; the rules come from the alert pattern and WCAG 2.2.1 and 4.1.3.

Fix

Announce toasts through one live region that is always present (role="status", role="alert" for errors). Do not auto-dismiss toasts that have a button or carry information the user must act on; keep them until closed. For short confirmations, show them for at least several seconds, pause the timer on hover and focus, and keep a close button. Never move focus into a toast; offer a keyboard path to its action (for example the same action in the page, or a documented shortcut).

Examples

// good: an undo toast stays until closed or used
showToast({ text: 'Message deleted', action: { label: 'Undo', run: undo }, timeout: null })

Sources

Facts

Id
a11y/toast-timing
Severity
moderate
Check
manual a person reviews it; the report lists it as a checklist
Applies to
page
WCAG 2.2
2.2.1, 4.1.3, level A
Taught by the skill
fe-a11y-carousel-toast Carousels and toasts
Since version
0.1.0

Rule file on GitHub

Read it in the terminal

npx github:dawidolko/frontend-skills explain a11y/toast-timing