aria-treeitem-name
Fungsinya
Skill ini memeriksa apakah item dalam widget pohon memiliki nama dan status expanded yang jelas. Cocok untuk pengembang yang membangun penjelajah file, navigasi bertingkat, atau bagan organisasi.
Kapan dipakai
- βSaat Anda membangun penjelajah file, navigasi bertingkat, atau tampilan pohon.
- βSaat item pohon memiliki nama kosong atau generik seperti folder atau item.
- βSaat item yang bisa diperluas tidak menyatakan apakah sedang terbuka atau tertutup.
Link skill
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-treeitem-name/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βPohon file saya membuat folder hanya diumumkan oleh pembaca layar sebagai item. Perbaiki namanya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memeriksa nama setiap item pohon, dengan urutan aria-labelledby, lalu aria-label, lalu teks yang terlihat, dan memastikan item yang bisa diperluas memiliki status expanded.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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-labelto override or supplement the visible text (e.g., adding file type context) - Use
aria-labelledbyto compose a name from multiple visible elements within the item - A treeitem with
aria-expandedmust 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
Pertanyaan umum
Apa yang diucapkan pembaca layar untuk item pohon yang baik?
Skill memberi contoh seperti src, collapsed, level 1, 1 of 3, yang mencakup nama, status, dan posisi.
Nama mana yang dipakai pembaca layar lebih dulu?
Skill menjelaskan pemeriksaan dimulai dari aria-labelledby, lalu aria-label, lalu isi teks yang terlihat.
Apakah item yang bisa diperluas memerlukan statusnya sendiri?
Ya. Skill menyatakan item yang memiliki anak perlu aria-expanded yang diatur ke true atau false.
Detail
Deskripsi asli dari pembuat
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.
Popularitas
- Bintang GitHub
- 75k
- Peringkat
- #2741
- Lisensi
- MIT
- Diperbarui
- 31/10/2026
Komentar
- β¦
Skill lain dari repositori ini
frontendchecklist
75kMemeriksa kode frontend dan halaman langsung terhadap lebih dari 380 aturan untuk aksesibilitas, kecepatan, SEO, dan keamanan, dengan alat baris perintah.
frontend-checklist-global
75kMengaudit proyek frontend terhadap seluruh 386 aturan Front-End Checklist, dan memberikan perbaikan spesifik untuk setiap masalah yang ditemukan.
404-page
75kMemeriksa bahwa halaman tidak ditemukan Anda menawarkan tautan yang membantu dan mengembalikan status 404 yang sebenarnya, untuk membantu pengunjung yang tersesat.
about-page
75kMeninjau apakah situs Anda memiliki halaman Tentang yang jelas yang menjelaskan siapa yang mengelolanya, untuk membangun kepercayaan pengunjung dan mesin pencari.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.