Accessibility in Blazor TreeView Component

13 Nov 20255 minutes to read

The Blazor TreeView component has been designed keeping in mind the WAI-ARIA specifications, and applies WAI-ARIA roles, states, and properties along with keyboard support. This component is characterized by complete keyboard interaction support and ARIA accessibility support that makes it easy for people who use assistive technologies (AT) and those who completely rely on keyboard navigation.

The Blazor TreeView component aligns with established accessibility guidelines and standards, including ADA, Section 508, and WCAG 2.2 standards. It implements WCAG roles to achieve high accessibility compliance.

The accessibility compliance for the Blazor TreeView component is outlined below.

Accessibility Criteria Compatibility
WCAG 2.2 Support Yes
Section 508 Support Yes
Screen Reader Support Yes
Right-To-Left Support Yes
Color Contrast Yes
Mobile Device Support Yes
Keyboard Navigation Support Yes
Axe-core Accessibility Validation Yes
Yes - All features of the component meet the requirement.
Partial - Some features of the component do not meet the requirement.
No - The component does not meet the requirement.

WAI-ARIA Attributes

The Blazor TreeView component implements the WAI-ARIA Tree View pattern to ensure comprehensive accessibility. The following ARIA attributes are used within the TreeView component’s structure:

Attributes Purpose
aria-multiselectable Indicates whether the TreeView 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 TreeView.

Keyboard Interaction

The Blazor TreeView component adheres to the WAI-ARIA keyboard interaction guidelines, providing robust keyboard navigation. This enables efficient use for individuals who rely on assistive technologies or prefer keyboard-only interaction. The component supports the following keyboard shortcuts:

Windows Mac Description
Goes to the previous node.
Goes to the next node.
Expands the current node.
Collapses the current node.
Home fn+ Goes to the first node.
End fn+ Goes to the last node.
F2 F2 Edits the focused node.
Esc Esc Focuses out the edit state without saving the edited text.
Enter return Selects the focused node/saves the edited text.
Space space Checks the current node.
Ctrl + A + A</kbd> Selects all nodes.

Ensuring Accessibility

The accessibility levels of the Blazor TreeView component are verified through regular automated testing using the axe-core software tool.

The accessibility compliance of the TreeView component is shown in the following sample. Open the sample in a new window to evaluate the accessibility of the TreeView component with accessibility tools.

See Also