Skip to main content
🎉 A11y Issue Detection Agent is now live! Detect accessibility issues like a WCAG expert with AI. Try now!
No Result Found
Connect and get help from 7,000+ developers on our Discord community. Ask the CommunityAsk the Community

aria-treeitem-name

Rule Severity : Serious

Description

The aria-treeitem-name rule ensures that elements with role="treeitem" have an accessible name. Tree widgets represent hierarchical data such as file directories or navigation menus. Each item in a tree must have a name so that screen reader users can identify what the item represents and navigate between items meaningfully.

This rule meets WCAG requirements by:

  1. Programmatic Name Determination (WCAG 4.1.2 Name, Role, Value): It ensures that the name of every interactive tree item can be programmatically determined by assistive technologies, enabling screen readers to announce the item’s purpose.
  2. Conveying Relationships (WCAG 1.3.1 Info and Relationships): It ensures the hierarchical structure and labels of tree items are accessible, not just conveyed visually.

To comply with this rule, every treeitem element must have a name provided via visible inner text, aria-label, or aria-labelledby.

Examples

Here, treeitem elements are empty and have no accessible names. A screen reader announces each only as “tree item”, providing no useful information about the content.

Incorrect Sample
Copy icon Copy

This example includes visible text inside each treeitem, which assistive technologies use as the accessible name.

Correct Sample
Copy icon Copy

How to fix?

To fix violations of the aria-treeitem-name rule, follow these steps:

  • Ensure each element with role="treeitem" contains visible text that describes the item.

  • If the item uses an icon or image without adjacent visible text, add an aria-label attribute to the treeitem element with a descriptive name.

  • If a visible label exists elsewhere on the page, use aria-labelledby on the treeitem to reference that element by its id.

Reference

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle