Saltar al contenido
Skillpedia
Sitios e interfaces (frontend)75 mil · #2741

aria-treeitem-name

Qué hace

Esta skill comprueba que los elementos de los widgets de árbol tengan nombres claros y estados de expansión. Es para desarrolladores que crean exploradores de archivos, navegación anidada o organigramas.

Cuándo usarla

  • ✓Cuando creas un explorador de archivos, una navegación anidada o una vista de árbol.
  • ✓Cuando los elementos del árbol tienen nombres vacíos o genéricos, como folder o item.
  • ✓Cuando los elementos desplegables no indican si están abiertos o cerrados.

Link de la skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-treeitem-name/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-treeitem-name/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Mi árbol de archivos muestra carpetas que los lectores de pantalla anuncian solo como item. Corrige los nombres.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Tu agente comprueba el nombre de cada elemento del árbol, usando aria-labelledby, luego aria-label y después el texto visible, y confirma que los elementos desplegables tienen un estado de expansión.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Provide accessible names for tree items

Tree widgets represent hierarchical data (file explorers, nested navigation, organization charts). Screen readers announce each focused treeitem's name, level, and position — e.g., 'src, collapsed, level 1, 1 of 3'. If the name is empty or generic ('folder', 'item'), blind users cannot distinguish between nodes and cannot navigate the hierarchy with confidence. VoiceOver on macOS uses the name to populate the rotor, and NVDA reads it as the user moves through the tree with arrow keys.

Quick Reference

  • Every element with role='treeitem' must have a non-empty accessible name
  • Text content of the element is used as the name by default — ensure it is descriptive
  • Use aria-label to override or supplement the visible text (e.g., adding file type context)
  • Use aria-labelledby to compose a name from multiple visible elements within the item
  • A treeitem with aria-expanded must also convey its expanded/collapsed state — this is separate from its name

Check

Find all elements with role='treeitem'. For each, determine its accessible name via the accname computation: check aria-labelledby first, then aria-label, then visible text content. Flag any treeitem with an empty or whitespace-only accessible name. Also check whether treeitems with children have aria-expanded set to 'true' or 'false' (not just absent).

Fix

For each unnamed treeitem: (1) If the element has visible text content that is descriptive, no change is needed — the text content becomes the accessible name. (2) If the visible text is ambiguous (e.g., an icon with no text), add aria-label='Descriptive name'. (3) If the item has multiple text parts (e.g., filename + file size), use aria-labelledby referencing the most descriptive element's id. (4) For expandable treeitems, ensure aria-expanded='true' or aria-expanded='false' is present and toggled on expand/collapse.

Explain

WAI-ARIA 1.2 requires that treeitem elements have an accessible name as part of the tree widget pattern. Screen readers convey position within the tree using: name + level (aria-level or DOM nesting depth) + set size (aria-setsize) + position in set (aria-posinset) + expanded state (aria-expanded). The name is the only user-facing identifier — without it, a user navigating by arrow keys hears only 'treeitem, level 2' with no way to know which node they are on.

Code Review

Review the rendered markup and interactive states that affect Provide accessible names for tree items. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/accessibility/aria-treeitem-name

Preguntas frecuentes

¿Qué dice un lector de pantalla de un buen elemento de árbol?

La skill da un ejemplo como src, collapsed, level 1, 1 of 3, que incluye el nombre, el estado y la posición.

¿Qué nombre usa primero el lector de pantalla?

La skill describe que primero se comprueba aria-labelledby, después aria-label y por último el texto visible.

¿Un elemento desplegable necesita su propio estado?

Sí. La skill indica que los elementos con hijos necesitan aria-expanded en true o false.

Detalles

Descripción original del autor

Use when applies to custom tree widgets built with role='tree', role='treeitem', and role='group'. Common in file explorers, nested navigation menus, org charts, and any UI where items can be expanded or collapsed to reveal children.

repo: thedaviddias/Front-End-Checklist

Popularidad

Estrellas en GitHub
75 mil
Posición en el ranking
#2741
Licencia
MIT
Actualizada
31/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas