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

listitem

Qué hace

Esta skill encuentra elementos de lista colocados fuera de una lista, por ejemplo dentro de un div o de un span, y los corrige. Es para creadores web y autores de plantillas que quieren listas válidas y accesibles.

Cuándo usarla

  • ✓Cuando le pides al agente que revise el marcado de los elementos de lista de una página o plantilla.
  • ✓Cuando un componente divide el marcado de una lista en varias partes y sospechas que algunos elementos no tienen lista padre.
  • ✓Cuando revisas listas ARIA personalizadas y quieres confirmar que los roles de elemento de lista están dentro de un rol de lista.

Link de la skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/listitem/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/listitem/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

“¿Puedes comprobar si algún elemento de lista de mi sitio no tiene su contenedor de lista?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

El agente revisa cada elemento de lista y comprueba que su padre sea un ul, un ol o un menu. Si no lo es, envuelve los elementos en el contenedor de lista correcto.

Contenido técnico (SKILL.md original)

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

Place list items within list containers

When a <li> element exists outside a list container, screen readers lose the ability to announce critical context: NVDA and JAWS will not say 'list of 5 items' or 'item 2 of 5' because there is no list context. VoiceOver may announce the orphan <li> as plain text without any group context, stripping users of the structural information that helps them understand how many items exist and where they are in the list.

Quick Reference

  • Every <li> element must have a direct parent of <ul>, <ol>, or <menu>
  • Orphan <li> elements are invalid HTML per the HTML Living Standard
  • Screen readers announce list type and item count (e.g., 'list, 3 items') only when <li> is inside a valid list container
  • Similarly, role='listitem' must be owned by a role='list' element per WAI-ARIA requirements

Check

Find all <li> elements in the DOM. For each, check that its direct parent element is <ul>, <ol>, or <menu>. Flag any <li> whose parent is <div>, <section>, <nav>, <span>, or any element other than those three. Also check role='listitem' elements to ensure their closest ancestor with a list-related role is role='list'.

Fix

For each orphan <li>: (1) Wrap it and any sibling <li> elements in the appropriate list container — use <ul> for unordered items or <ol> for sequentially ordered items. (2) If the <li> was being used purely for styling (e.g., a bullet point visual), replace it with a <div> or <p> and apply the visual style via CSS. (3) If inside a navigation element, ensure <nav><ul><li> nesting is maintained.

Explain

The HTML Living Standard specifies that <li> elements are only valid as children of <ul>, <ol>, or <menu>. This is a structural requirement, not a style preference. Screen readers use the list container to announce the list type ('bullet list' vs 'numbered list') and the total item count. Without the container, this context is lost entirely. Additionally, when list-style: none is applied to a <ul>, some browsers strip the list semantics — if this is intentional (e.g., a navigation menu), add role='list' to the <ul> to restore list semantics for screen readers.

Code Review

Review the rendered markup and interactive states that affect Place list items within list containers. 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/listitem

Preguntas frecuentes

¿Por qué un elemento de lista necesita un padre de lista?

Sin él, los lectores de pantalla no pueden indicar cuántos elementos existen ni en qué posición están dentro de la lista.

¿Qué elementos padre están permitidos?

La skill indica ul, ol y menu como padres válidos para los elementos de lista.

¿Qué pasa con los atributos de rol personalizados?

La skill también comprueba que los elementos con un rol listitem estén dentro de un elemento con un rol de lista.

Detalles

Descripción original del autor

Use when applies to HTML documents with `<li>` elements. Also applies to custom ARIA lists where `role='listitem'` must be owned by `role='list'`. Common violations occur in templating systems where list markup is split across components or in CSS resets where developers use `<li>` for layout without proper list parents.

repo: thedaviddias/Front-End-Checklist

Popularidad

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

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas