modal-accessibility
できること
このスキルは、モーダルダイアログに正しい役割、ラベル、キーボード操作があるかを確認します。誰もが使えるポップアップを作りたいフロントエンド開発者向けです。
使う場面
- ✓ポップアップやモーダルのアクセシビリティをレビューしてほしいとき。
- ✓キーボードの利用者がダイアログの中で動けなくなったり、閉じられなかったりするとき。
- ✓基本的なアクセシビリティのルールに沿った新しいダイアログを作るとき。
スキルのリンク
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/modal-accessibility/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“キーボードの利用者がポップアップを開いたり、使ったり、閉じたりできるか確認してもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、ダイアログに正しい ARIA の役割とラベルがあるかを確認し、Tab のフォーカスをダイアログ内に保ち、Escape キーで閉じられ、開いた要素にフォーカスが戻るようにします。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Make modal dialogs keyboard accessible
Without proper focus trapping and keyboard handling, modal dialogs are invisible traps for keyboard users—they can't navigate, can't escape, and can't complete tasks.
Quick Reference
- Use role='dialog' and aria-modal='true' on the modal container
- Trap focus inside the modal—Tab should cycle within modal only
- Close on Escape key press and return focus to trigger element
- Add aria-labelledby pointing to the modal title
Check
Verify modals have proper ARIA roles, focus trapping, keyboard dismissal (Escape), and return focus on close.
Fix
Implement accessible modals using role='dialog', aria-modal='true', focus trapping, and proper keyboard handling.
Explain
Explain the accessibility requirements for modal dialogs including focus management, ARIA attributes, and keyboard interaction.
Code Review
Review the rendered markup and interactive states that affect Make modal dialogs keyboard accessible. 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/modal-accessibility
よくある質問
ダイアログにはどの役割を付けるべきですか?
コンテナに、aria-modal を true にした role dialog を付けることを勧めています。
閉じた後にフォーカスを戻すのはなぜですか?
キーボードの利用者が、ページ上の位置を失わず、元の場所から操作を続けられるようにするためです。
ダイアログにはタイトルが必要ですか?
はい。このスキルは、aria-labelledby でモーダルのタイトルを指すことを勧めています。
詳細
作者による元の説明
Use when reviewing rendered HTML, interactive components, or design-system patterns related to Make modal dialogs keyboard accessible. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.
人気
- GitHubのスター
- 75k
- ランキング
- #2942
- ライセンス
- 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 において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。