Skip to the page

Keyboard, focus and widgets · mid

Announcing dynamic changes with live regions

Content that changes without focus moving (search result counts, 'Added to cart', form errors after submit, toasts) is invisible to screen-reader users unless it is inside a live region: role=status or aria-live="polite" for normal updates, role=alert for urgent ones, present in the DOM before the text changes.

The notes

What you must know

  • aria-live="polite" waits until the screen reader is idle; "assertive" interrupts. role=status is polite; role=alert is assertive.
  • The live region element must already exist (usually empty) before you put text in it; inserting a new region together with its text is often not announced.
  • aria-atomic="true" reads the whole region on any change ('3 items in cart', not just '3').
  • Keep messages short and meaningful; don't announce every keystroke result; debounce counts for search.
  • Toasts: use role=status (or alert for errors) and don't auto-hide important messages too fast (WCAG 2.2.1 timing); never put the only copy of an action (Undo) in a toast that disappears.
  • Moving focus is often better than announcing for big changes (opening a dialog, new page); live regions are for small status updates.

The red pen

Common traps: mistake → fix

  • Mistake: "Use assertive for everything so users hear it"

    Fix: it interrupts constantly; use polite unless it's urgent.

  • Mistake: "Render the live region only when there's a message"

    Fix: the region must exist before the content changes.

Easy to hard

Questions interviewers ask, easy to hard

  1. How does a screen-reader user find out that search results updated?
  2. aria-live polite vs assertive vs role=alert?
  3. How do you make toast notifications accessible?

Practise

Practise with these questions

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview