liveBook · Manning

Alert role

As explained in Architecting Accessibility

The alert role is an ARIA live-region role for urgent, time-sensitive messages that require immediate attention.

When a user needs to act immediately—such as before a session times out—use role="alert" to announce the message without waiting for the screen reader to finish its current announcement. section 6.1.7

Use the alert role selectively:

  • Reserve it for critical, time-sensitive information; its assertive announcement can interrupt ongoing speech. section 3.4.4
  • Do not use it for routine updates: unnecessary alerts can create audio clutter, confusion, and fatigue. Use the less-interruptive status role for non-urgent updates. section 6.1.7
  • Do not rely on an announcement being prefixed with “Alert”; support for that behavior is inconsistent. section 6.1.7

Urgent session warning

A container such as <div role="alert">Your session is about to time out</div> marks the message as an urgent live-region update. section 6.1.7

How Architecting Accessibility covers it

How deep it goes
Specifies assertive announcements and implicit atomicity, and notes inconsistent support for announcement prefixes.
Examples
Uses session-timeout warnings and critical alerts as examples of urgent messages.
What you can do after
Apply alert semantics to announce critical, time-sensitive updates that users might otherwise miss.
How it connects
Connects alert to ARIA live regions, aria-live, aria-atomic, screen readers, and the less-interruptive status role.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting Accessibility. The section links point to the parts of the book it draws on.