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

aria-required-children

Qué hace

Esta skill comprueba widgets compuestos, como listas de pestañas, menús y árboles, en busca de los elementos hijos correctos. Es para desarrolladores que crean pestañas, listas o menús personalizados con elementos div y span.

Cuándo usarla

  • ✓Cuando creas un conjunto de pestañas, un menú o un listbox personalizado con elementos div.
  • ✓Cuando un lector de pantalla no anuncia el número de elementos de una lista o menú.
  • ✓Cuando creas un control de lista, de selección o de navegación personalizado en lugar de HTML nativo.

Link de la skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-required-children/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-required-children/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 barra de pestañas personalizada usa divs simples. Asegúrate de que los elementos de pestaña tengan los roles correctos dentro de la lista de pestañas.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Tu agente comprueba cada rol contenedor frente a los roles hijos que debe contener, como tab dentro de tablist o listitem dentro de list, y añade roles de presentación a los elementos envoltorio cuando hace falta.

Contenido técnico (SKILL.md original)

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

Ensure ARIA roles contain required child roles

Screen readers like NVDA and VoiceOver navigate composite widgets (menus, tabs, trees) by moving between the required child roles. If a tablist contains <div> elements instead of role='tab', the user hears no tabs at all. JAWS announces 'list of 5 items' only when role='listitem' children exist inside role='list'. Without correct nesting, the entire widget becomes opaque to keyboard-only and screen reader users.

Quick Reference

  • Container roles mandate specific owned child roles: tablist → tab, list/listbox → listitem/option, menu/menubar → menuitem, tree → treeitem, grid/rowgroup → row
  • Missing required children break the accessibility tree so screen readers cannot enumerate items or announce counts
  • Use role='none' or role='presentation' on purely structural wrapper elements inside the container to avoid invalid nesting
  • Applies to WAI-ARIA 1.2 required owned elements for composite widget roles

Check

Identify all elements with ARIA container roles (tablist, list, listbox, menu, menubar, tree, treegrid, grid, rowgroup, radiogroup). For each, verify it contains the required owned child roles per the WAI-ARIA spec: tablist must own tab elements; list must own listitem; listbox must own option; menu/menubar must own menuitem, menuitemcheckbox, or menuitemradio; tree must own treeitem; grid must own row (which owns gridcell); radiogroup must own radio. Flag any container roles missing required children.

Fix

For each container role missing its required children: (1) Add the correct role to each child element — e.g., add role='tab' to each tab button inside role='tablist'. (2) If wrapper <div> elements exist between the container and the required children for layout purposes, add role='none' or role='presentation' to those wrappers. (3) Prefer native HTML equivalents where possible: <ul>/<li> instead of role='list'/role='listitem', <select>/<option> instead of role='listbox'/role='option'.

Explain

WAI-ARIA 1.2 defines 'required owned elements' for composite widget roles — these are the child roles a container must contain for the widget to be valid. Screen readers build their understanding of a widget from this structure. A tablist without tab children means a screen reader user in Forms Mode will find nothing to navigate between. A menu without menuitem children will not be announced as a menu at all in some ATs. This is distinct from aria-required-parent, which checks the inverse direction.

Code Review

Review the rendered markup and interactive states that affect Ensure ARIA roles contain required child roles. 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-required-children

Preguntas frecuentes

¿Qué pasa si faltan los roles hijos?

La skill indica que los lectores de pantalla pueden no anunciar los elementos ni sus cantidades, lo que rompe la navegación.

¿Para qué sirve el rol none?

Marca envoltorios puramente estructurales para que no rompan la estructura obligatoria.

¿Qué roles menciona como ejemplos?

Menciona tab dentro de tablist, listitem dentro de list, option dentro de listbox y menuitem dentro de menu.

Detalles

Descripción original del autor

Use when applies to custom ARIA widgets using composite roles: tablist, list, listbox, menu, menubar, tree, treegrid, grid, rowgroup, row, radiogroup. Use when reviewing components built with div/span elements that replace native HTML list, select, or nav elements.

repo: thedaviddias/Front-End-Checklist

Popularidad

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

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas