A live region is an element whose content changes are announced by screen readers without moving focus, for things like "3 results found", "Saved", "Item added to cart" or a form error summary. Use role="status" (implicitly aria-live="polite": announced when the user is idle) for most updates, and role="alert" (implicitly assertive: interrupts) only for urgent, time-sensitive errors. The number-one rule: the live region must already be in the DOM, and registered by the screen reader, before you change its content. Inserting a region that already contains text is often not announced. WCAG 4.1.3 (Status Messages) requires this kind of announcement for status changes that don't receive focus.
| Attribute / role | Meaning |
|---|---|
aria-live="polite" | Announce after current speech finishes |
aria-live="assertive" | Interrupt current speech. Use rarely |
role="status" | Polite + aria-atomic="true" implied |
role="alert" | Assertive + atomic. For errors that need immediate attention |
role="log" | Polite, new additions only (chat messages) |
aria-atomic="true" | Read the whole region, not just the changed node |
aria-relevant | Which changes count (additions text by default). Rarely needed, and support is inconsistent |
<output> | Native element with an implicit status role, good for calculated results |
<!-- Rendered once at app start, visually hidden but not display:none -->
<div id="announcer" role="status" class="visually-hidden"></div>
let timer;
export function announce(message) {
const el = document.getElementById('announcer');
el.textContent = ''; // clear so repeat messages re-announce
clearTimeout(timer);
timer = setTimeout(() => { el.textContent = message; }, 100);
}
// After filtering
announce(`${results.length} results for “${query}”`);
.visually-hidden {
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
Why the clear-then-set dance: identical consecutive text may not be re-announced, and setting content in the same tick as creating the region is often missed.
aria-describedby.role="alert".<h1> (with tabindex="-1") or announce the new title. Many routers now do one of these by default.display: none or hidden on the region: hidden content isn't announced. Use the visually-hidden pattern.assertive everywhere, which keeps interrupting the user.status/alert/log, and aria-atomic.Spotted a mistake or a rights concern? Report an issue