Accessibility in React Tree View
4 Sep 20266 minutes to read
The React Tree View component followed the accessibility guidelines and standards, including ADA, Section 508, WCAG 2.2 standards, and WCAG roles that are commonly used to evaluate accessibility.
The accessibility compliance for the React Tree View component is outlined below.
| Accessibility Criteria | Compatibility |
|---|---|
| WCAG 2.2 Support | ![]() |
| Section 508 Support | ![]() |
| Screen Reader Support | ![]() |
| Right-To-Left Support | ![]() |
| Color Contrast | ![]() |
| Mobile Device Support | ![]() |
| Keyboard Navigation Support | ![]() |
| Accessibility Checker Validation | ![]() |
| Axe-core Accessibility Validation | ![]() |
- All features of the component meet the requirement.
- Some features of the component do not meet the requirement.
- The component does not meet the requirement.WAI-ARIA attributes
The TreeView component followed the WAI-ARIA patterns to meet the accessibility. The following ARIA attributes are used in the TreeView component:
| Attributes | Purpose |
|---|---|
role=tree |
All tree nodes are contained within the element. |
role=treeitem |
Specifies the role of each tree node in a selectable React Tree View and its containment within the tree. |
role=group |
Specifies the role of each parent node container. |
role=checkbox |
Indicates checkbox control along with treeitem element. |
aria-multiselectable |
Indicates whether the React Tree View enables multiple selection or not. |
aria-expanded |
Indicates whether the parent node has expanded or not. |
aria-selected |
Indicates the selected node. |
aria-grabbed |
Indicates the selected state on drag-and-drop of node. |
aria-level |
Indicates the level of node in React Tree View. |
aria-checked |
Indicates the current checked state of React Tree View checkbox. |
aria-label |
Indicates the contextual message for the React Tree View checkbox. |
aria-activedescendant |
Identifies the currently active element when focusing on the React Tree View. |
aria-disabled |
Indicates element is perceivable but disabled. |
Keyboard interaction
The React Tree View component followed the keyboard interaction guideline, making it easy for people who use assistive technologies (AT) and those who completely rely on keyboard navigation. The following keyboard shortcuts are supported by the React Tree View component.
| Interaction Keys | Description |
|---|---|
| Arrow Up | Goes to the previous node. |
| Arrow Down | Goes to the next node. |
| Arrow Right | Expands the current node. |
| Arrow Left | Collapses the current node. |
| Home | Goes to the first node. |
| End | Goes to the last node. |
| F2 | Edits the focused node. |
| Esc | Focuses out the edit state without saving the edited text. |
| Enter | Selects the focused node/saves the edited text. |
| Space | Checks the current node. |
| Ctrl + A | Selects all nodes. |
Ensuring accessibility
The React Tree View component’s accessibility levels are ensured through an accessibility-checker and axe-core software tools during automated testing.
The accessibility compliance of the React Tree View component is shown in the following sample. Open the sample in a new window to evaluate the accessibility of the React Tree View component with accessibility tools.