ARIA treeitem elements have accessible names

Tree navigation items have labels that screen readers can announce.

On this page

Impact

ScanGov impact ratings

About

When a treeitem element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers.

Risks

Screen readers cannot identify items in a tree or folder navigation.

Why it's important

Ensures assistive technologies like screen readers can correctly interpret and announce page elements to users with disabilities.

User stories

As a screen reader user, I want ARIA attributes to be correctly implemented so that I can understand the purpose and state of interactive elements.

Code

Failing pattern:

<!-- Fail: treeitem with no accessible name -->
<li role="treeitem"></li>

Passing pattern:

<!-- Pass: treeitem contains visible text -->
<ul role="tree">
  <li role="treeitem">Documents</li>
</ul>

Error

ScanGov messaging when a site fails a standard:

Failed: ARIA treeitem elements have accessible names

Guidance

Indicators

On this page