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

listitem

O que ela faz

Esta skill encontra itens de lista colocados fora de uma lista, como dentro de uma div ou de um span, e os corrige. Ela é para criadores web e autores de templates que querem listas válidas e acessíveis.

Quando usar

  • ✓Quando você pede ao agente para verificar a marcação de itens de lista em uma página ou template.
  • ✓Quando um componente divide a marcação de uma lista em várias partes e você suspeita que alguns itens não têm uma lista pai.
  • ✓Quando você revisa listas ARIA personalizadas e quer confirmar que os papéis de item de lista ficam dentro de um papel de lista.

Link da skill

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

“Você pode verificar se algum item de lista do meu site está sem o contêiner de lista?”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente analisa cada item de lista e verifica se o pai é um elemento ul, ol ou menu. Quando não é, ele envolve os itens no contêiner de lista correto.

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

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

Perguntas frequentes

Por que um item de lista precisa de um pai de lista?

Sem ele, leitores de tela não conseguem informar quantos itens existem nem onde o usuário está na lista.

Quais elementos pais são permitidos?

A skill lista ul, ol e menu como pais válidos para itens de lista.

E os atributos de papel personalizados?

A skill também verifica se os elementos com papel listitem ficam dentro de um elemento com papel de lista.

Detalhes

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

Popularidade

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

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas