Pular para o conteúdo
Skillpedia
Sites e telas (frontend)75 mil · #2741

aria-treeitem-name

O que ela faz

Esta skill verifica se os itens de widgets de árvore têm nomes claros e estados de expansão. Ela é para desenvolvedores que criam exploradores de arquivos, menus aninhados ou organogramas.

Quando usar

  • ✓Quando você cria um explorador de arquivos, uma navegação aninhada ou uma visualização em árvore.
  • ✓Quando os itens de árvore têm nomes vazios ou genéricos, como pasta ou item.
  • ✓Quando itens expansíveis não informam se estão abertos ou fechados.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-treeitem-name/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“A árvore de arquivos mostra pastas que leitores de tela anunciam apenas como item. Corrija os nomes.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente verifica o nome de cada item de árvore, usando aria-labelledby, depois aria-label e depois o texto visível, e confirma que itens expansíveis têm um estado de expansão.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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

Perguntas frequentes

O que um leitor de tela diz de um bom item de árvore?

A skill dá um exemplo como src, recolhido, nível 1, 1 de 3, que inclui o nome, o estado e a posição.

Qual nome o leitor de tela usa primeiro?

A skill descreve que se verifica primeiro aria-labelledby, depois aria-label e depois o conteúdo de texto visível.

Um item expansível precisa de estado próprio?

Sim. A skill diz que itens com filhos precisam de aria-expanded definido como true ou false.

Detalhes

Descrição original do 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

Popularidade

Estrelas no GitHub
75 mil
Posição no ranking
#2741
Licença
MIT
Atualizada em
31/10/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas