本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #2942

modal-accessibility

できること

このスキルは、モーダルダイアログに正しい役割、ラベル、キーボード操作があるかを確認します。誰もが使えるポップアップを作りたいフロントエンド開発者向けです。

使う場面

  • ✓ポップアップやモーダルのアクセシビリティをレビューしてほしいとき。
  • ✓キーボードの利用者がダイアログの中で動けなくなったり、閉じられなかったりするとき。
  • ✓基本的なアクセシビリティのルールに沿った新しいダイアログを作るとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/modal-accessibility/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/modal-accessibility/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

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.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2942
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル