Notification
How it works
Notification Carbon components are messages that communicate information to a user. The WAI-ARIA
role="status"
role="log"
aria-live="polite"
role="alert"
aria-live="assertive"
role="status"
role="log"
Details pertaining to these roles include specifics around containing interactive elements, focus behavior, close behavior, and semantic contents. The
role
status
log
alert
Escape
aria-hidden="true"
<li>
Notification components are allowed interactive children (actions) though, and when an interactive element is provided, a
role="alertdialog"
aria-label="close"
aria-hidden="true"
Tab
Space
Enter
Escape
Accessibility considerations
-
Avoid using a toast notification for critical alerts or long messages because they are timed and will disappear automatically making it difficult for people with various disabilities to get the entire message. An alert that disappears too quickly can lead to failure of the optional WCAG 2.0 success criterion 2.2.3 (AAA).
-
Provide a means to turn off nonessential alerts to enhance usability for people with visual and cognitive disabilities. Additional information is available in WCAG 2.0 success criterion 2.2.4 (AAA). Note: Providing this functionality is optional.
-
Ensure the use of color and hidden icons are not used as the only means of conveying the importance of the notification.
Resources
Helpful resources for creating customized accessible implementations
- W3C W3C WAI-ARIA Authoring Practices Alert Design Pattern covers the usage of ARIA names, state and roles.
- W3C W3C Web Accessibility Tutorial - User Notifications provides a tutorial on notification accessibility.
- IBM Accessibility Requirements:
- 3.3.1 Error Identification (WCAG Success Criteria 3.3.1)
- 3.3.2 Labels and Instructions (WCAG Success Criteria 3.3.2)
- 3.3.3 Error Suggestion (WCAG Success Criteria 3.3.3)
Accessibility testing
Accessibility testing statusFor every latest release, Carbon runs tests on all components to meet the accessibility requirements. These different statuses report the work that Carbon has done in the back end. These tests appear only when the components are stable.
For every latest release, Carbon runs tests on all components to meet the accessibility requirements. These different statuses report the work that Carbon has done in the back end. These tests appear only when the components are stable.
Latest version: | Framework: React (@carbon/react)
Component | Accessibility test | Status | Link to source code |
---|---|---|---|
Notification | Test(s) that ensure the initial render state of a component is accessible. | Passes all automated tests with no reported accessibility violations. | GitHub link |
Tests that ensure additional states of the component are accessible. This could be interactive states of a component or its multiple variants. | Passes all automated tests with no reported accessibility violations. | ||
Tests that ensure focus is properly managed, and all interactive functions of a component have a proper keyboard-accessible equivalent. | Passes all automated tests with no reported accessibility violations. | ||
This manual testing ensures that the visual information on the screen is properly conveyed and read correctly by screen readers such as JAWS, VoiceOver, and NVDA. | A human has manually tested this component, e.g. screen reader testing. |