ARIA Widget Roles
ARIA role: tree
A hierarchical collection of expandable items. Implement arrow navigation, expansion, Home/End and focus management. Static structure only; a nested list may be enough for ordinary content. Explicit roles do not implement visual presentation, interaction or focus management; verify allowed role/element combinations in ARIA in HTML. Accessibility exposure varies with browser, platform and assistive technology. Test relevant combinations; rendering is not proof of accessibility.
Formal Syntax & Structure
html syntaxhtml
role="tree"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| role | token | Explicit role token tree; use only where allowed. Omit when native semantics match. |
| aria-multiselectable | boolean | Relevant when applicable. Indicates that more than one item can be selected in a composite widget. Keep each item's selection state synchronized and implement its multi-selection interaction. Prefer select multiple for simple lists. Values: true, false. |
| aria-activedescendant | ID reference | Relevant when applicable. Keeps DOM focus on a composite or controlling input while reporting a particular descendant as active. Update it as keyboard navigation changes the active item; ensure the reference meets the ownership rules. It does not move DOM focus or scroll the active item into view. Values: ID of active owned or controlled item. |
Working Example
Example Snippethtml
<div role="tree" aria-label="Folders"> <div role="treeitem" aria-expanded="true" tabindex="0"> Projects <div role="group"> <div role="treeitem" tabindex="-1">Website</div> </div> </div></div>