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
