Semantics
An item in a tree.
Additional info from the ARIA specification
A treeitem element can contain a sub-level group of elements that can be expanded or collapsed. An expandable collection of treeitem elements are enclosed in an element with the group role.
Authors MUST ensure elements with role treeitem are accessibility children of an element with role tree or an element with role group that is the accessibility child of an element with role treeitem.
In certain conditions, a user agent MAY provide an implicit value for aria-selected for each treeitem in a tree, and if it does, the user agent MUST ensure the following conditions are met before providing an implicit value:
If a user agent provides an implicit aria-selected value for a treeitem, the value SHOULD be true if the treeitem has DOM focus or the tree has DOM focus and the treeitem is referenced by aria-activedescendant. Otherwise, if a user agent provides an implicit aria-selected value for a treeitem, the value SHOULD be false.
Authors MAY indicate selection for treeitem elements using either aria-selected or aria-checked. Some user interfaces indicate selection with aria-selected in single-select trees and with aria-checked in multi-select trees. Authors SHOULD NOT specify both aria-selected and aria-checked on treeitem elements contained by the same tree except in the extremely rare circumstances where all the following conditions are met:
Abstract Role
WidgetRepresents a focusable, interactive element.
Content Category
Only Used with Specific Parent Roles
This role must be a direct descendant of one of the following roles:
treegroup
Allowed Descendants
Phrasing Children Allowed
Note
Children Become Presentational
Browsers automatically apply the presentation role to all descendant elements, so their semantics are not conveyed to assistive technologies.
Usage
Allowed HTML elements
Implicit semantics
- None
Explicitly allowed
a[href][role=treeitem]img[role=treeitem]
Elements that can have any role
abbr[role=treeitem]address[role=treeitem]b[role=treeitem]blockquote[role=treeitem]canvas[role=treeitem]cite[role=treeitem]code[role=treeitem]custom-element[role=treeitem]data[role=treeitem]del[role=treeitem]dfn[role=treeitem]div[role=treeitem]em[role=treeitem]figure[role=treeitem]i[role=treeitem]ins[role=treeitem]kbd[role=treeitem]mark[role=treeitem]output[role=treeitem]p[role=treeitem]pre[role=treeitem]q[role=treeitem]samp[role=treeitem]small[role=treeitem]span[role=treeitem]table[role=treeitem]tbody[role=treeitem]tfoot[role=treeitem]thead[role=treeitem]time[role=treeitem]u[role=treeitem]var[role=treeitem]