Alert
On this page
Keyboard interactions
A user should have the ability to navigate to and interact with alerts using their keyboard.
| Key | Result |
|---|---|
| Tab | Moves focus to the next interactive element (e.g., from the close button to the first action button in the alert) |
| Shift + Tab | Moves focus to the previous interactive element (e.g., from the first action button in the alert back to the close button) |
| Enter | Triggers the close button, an action button, or link |
Focus order
A logical focus order helps users understand and operate our websites and products. Elements need to receive focus in an order that preserves meaning. Therefore the focus order should make sense and not jump around randomly.
Toasts
Accessibility considerations
There are accessibility considerations to keep in mind when using toasts. See our toast pattern accessibility guidelines for more information.
Toasts created with RhAlert.toast() are not the same as inline alerts in how
assistive technology exposes them.
The toast container uses role="status" and aria-live="polite", so updates
are announced as polite status messages, not as an interrupting role="alert".
Inline alerts use role="alert" on the alert surface. Do not assume a toast
has the same urgency or immediacy as an inline alert.
Toasts render inside a single "toaster" region appended to document.body, not
next to the control that triggered them. That separation affects reading order
and discovery (WCAG 1.3.2 Meaningful Sequence).
Design mitigations (when to use a toast, persistence, redundant in-context feedback)
are covered at toast Alert pattern — Accessibility.
RhAlert.toast() does not move keyboard focus into the toast when it appears.
Many screen reader users will still hear the announcement; sighted keyboard
users must Tab to the toast to reach the dismiss control and any
actions.
ARIA Authoring Practices Guide (APG)
Learn to use the accessibility semantics defined by the Accessible Rich Internet Application (ARIA) specification to create accessible web experiences.
Web Content Accessibility Guidelines
Understanding documents provide detailed explanations for Web Content Accessibility Guidelines (WCAG) guidelines and success criteria.
Automated testing
Some of our elements may receive errors or warnings that are false positives from automated testing tools. If you are experiencing some of these issues, please read our update on false positives in automated tools.
-
SC 2.1.1 Keyboard (Level A)
-
SC 2.1.3 Keyboard (no exception) (Level AAA)
-
SC 2.4.3 Focus order (Level A)
-
SC 2.5.5 Target size (Level AAA)
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.