listitem
できること
このスキルは、div や span の中など、リストの外に置かれたリスト項目を見つけて修正します。有効でアクセシブルなリストを作りたいウェブ制作者やテンプレート作成者向けです。
使う場面
- ✓ページやテンプレートのリスト項目のマークアップを確認してほしいとき。
- ✓コンポーネントがリストを複数の部分に分けていて、親のリストがない項目があるかもしれないとき。
- ✓カスタムARIAリストをレビューし、listitem の役割が list の役割の中にあるか確認したいとき。
スキルのリンク
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/listitem/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のサイトで、リストのラッパーがないリスト項目がないか確認してもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは各リスト項目を調べ、親要素が ul、ol、menu のいずれかであるかを確認します。そうでない場合は、項目を正しいリストの要素で包みます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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 arole='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
よくある質問
リスト項目にはなぜ親のリストが必要なのですか?
親のリストがないと、スクリーンリーダーは項目数や現在の位置を伝えられないためです。
どの親要素が有効ですか?
このスキルは、リスト項目の有効な親として ul、ol、menu を挙げています。
カスタムの role 属性はどうですか?
このスキルは、listitem の役割を持つ要素が list の役割を持つ要素の中にあるかも確認します。
詳細
作者による元の説明
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.
人気
- GitHubのスター
- 75k
- ランキング
- #2925
- ライセンス
- MIT
- 更新日
- 2026/10/31
コメント
- …
このリポジトリの他のスキル
frontendchecklist
75kコマンドラインツールを使って、フロントエンドのコードとライブページを、アクセシビリティ、速度、SEO、セキュリティに関する380以上のルールと照らし合わせて確認します。
frontend-checklist-global
75kフロントエンドのプロジェクトを、386のFront-End Checklistのルールすべてと照らし合わせて監査し、見つかった問題ごとに具体的な修正方法を示します。
404-page
75k見つからないページの画面に役立つリンクがあり、本物の404ステータスを返すかを確認し、迷った訪問者が目的のページを見つけられるようにします。
about-page
75kサイトの運営者が誰かを説明する、分かりやすいAboutページがあるかを確認し、訪問者と検索エンジンからの信頼を高めます。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。