WAI-ARIA: Role=Treeitem
Description
An option item of a tree. This is an element within a tree that may be expanded or collapsed if it contains a sub-level group of tree item elements.
A collection of treeitem elements to be expanded and collapsed are enclosed in an element with the group role.
Authors MUST ensure elements with role treeitem are contained in, or owned by, an element with the role group or tree.
Role=Treeitem Example
HTML Example
In the following code sample, because the anchor (HTML a element) is acting as the treeitem, the list item (HTML li element) is assigned an explicit WAI-ARIA role of presentation to override the user agent’s implicit native semantics for list items.
<ul role="tree">
<li role="presentation">
<a role="treeitem" aria-expanded="true">An expanded tree node</a>
</li>
…
</ul>
Characteristics
Superclass Role
- listitem
- option
Required Context Role
- group
- tree
Inherited States and Properties
- aria-atomic
- aria-busy (state)
- aria-checked (state)
- aria-controls
- aria-current (state)
- aria-describedby
- aria-details
- aria-disabled (state)
- aria-dropeffect
- aria-errormessage
- aria-expanded (state)
- aria-flowto
- aria-grabbed (state)
- aria-haspopup
- aria-hidden (state)
- aria-invalid (state)
- aria-keyshortcuts
- aria-label
- aria-labelledby
- aria-level
- aria-live
- aria-owns
- aria-posinset
- aria-relevant
- aria-roledescription
- aria-selected (state) (required)
- aria-setsize
Name From
- contents
- author
Accessible Name Required
- True
Semantic HTML
No HTML element equivalent.
Reference
- WAI-ARIA 1.2 Specification
Refer to the notes from the WAI-ARIA 1.2 specification for more information on role=treeitem.