Dostępność

Dialogs and modals

Builds modal and non-modal dialogs, alert dialogs, drawers and confirmations that work with keyboard and screen readers (WAI-ARIA APG Dialog pattern) on the native dialog element - name, initial focus, inert background, Escape, focus return. Use when adding a modal, popup, drawer, lightbox, cookie or confirm dialog in any stack, or when asked "make this modal accessible".

fe-a11y-dialogkażdego projektu webowego5 regułładowane zawsze: 82 tokeny; przy użyciu: 846 tokenów; w referencjach na żądanie: 1280 tokenów.

Instalacja

init instaluje ten skill, gdy projekt używa: każdego projektu webowego. Wybierz agenta, aby zobaczyć, gdzie trafią jego pliki.

Agent
npx github:dawidolko/frontend-skills init

Bez --agents polecenie init rozpoznaje agentów po tym, co projekt już ma, a gdy nie znajdzie żadnego, pyta:

Po czym init rozpoznaje każdego z agentów (17)
AgentRozpoznawany po
Claude CodeCLAUDE.md .claude CLAUDE.local.md
OpenAI Codex.codex AGENTS.override.md
Cursor.cursor .cursorrules
GitHub Copilot.github/copilot-instructions.md .github/instructions .github/skills .github/prompts
Gemini CLIGEMINI.md .gemini
Antigravity CLI.agents/rules .agent/rules
Devin / Windsurf.devin .windsurf .windsurfrules
OpenCodeopencode.json opencode.jsonc .opencode
Cline.clinerules .cline
Zed.rules .zed
JetBrains Junie.junie
Kiro.kiro
Augment.augment .augment-guidelines
Trae.trae
Continue.continue
Amazon Q Developer.amazonq
Aider.aider.conf.yml CONVENTIONS.md

Gdzie trafia fe-a11y-dialog dla: Claude Code

  • .claude/skills/fe-a11y-dialog/SKILL.mdskill
  • .claude/skills/fe-a11y-dialog/references/dialog.mdskill
  • .claude/rules/fe-a11y-dialog.mdplik reguł
  • CLAUDE.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

.claude/rules/fe-a11y-dialog.md
---
paths:
  - "**/*.html"
  - "**/*.jsx"
  - "**/*.tsx"
  - "**/*.vue"
  - "**/*.svelte"
  - "**/*.astro"
  - "**/*.component.html"
---

# Dialogs and modals (frontend-skills)

Builds modal and non-modal dialogs, alert dialogs, drawers and confirmations that work with keyboard and screen readers (WAI-ARIA APG Dialog pattern) on the native dialog element - name, initial focus, inert background, Escape, focus return. Use when adding a modal, popup, drawer, lightbox, cookie or confirm dialog in any stack, or when asked "make this modal accessible".

- Use `<dialog>` with `showModal()` for modals and `show()` for non-modal ones, not a `div role="dialog"` (a11y/dialog-native).
- Every dialog has a name: `aria-labelledby` pointing at its visible heading (a11y/dialog-name).
- On open, focus goes inside; Tab stays inside a modal; Escape closes; on close, focus returns to the trigger (a11y/dialog-focus).
- The page behind a modal is inert, never just `aria-hidden` over focusable content (a11y/aria-hidden-focusable).
- Only an open modal keeps focus inside; a closed one releases it (a11y/no-keyboard-trap).
- A visible close or cancel button is inside the dialog and in the Tab order.
- Confirmations of destructive actions use `role="alertdialog"` with `aria-describedby` on the message, and focus the safe choice.
- Do not open a modal on page load or on hover; open it from a user action.

Before larger changes, read the full skill: `.claude/skills/fe-a11y-dialog/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: OpenAI Codex

  • .agents/skills/fe-a11y-dialog/SKILL.mdskill
  • .agents/skills/fe-a11y-dialog/references/dialog.mdskill
  • AGENTS.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

OpenAI Codex nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

AGENTS.md
## Front-end work (frontend-skills)

- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Cursor

  • .agents/skills/fe-a11y-dialog/SKILL.mdskill
  • .agents/skills/fe-a11y-dialog/references/dialog.mdskill
  • .cursor/rules/fe-a11y-dialog.mdcplik reguł
  • AGENTS.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

.cursor/rules/fe-a11y-dialog.mdc
---
description: Builds modal and non-modal dialogs, alert dialogs, drawers and confirmations that work with keyboard and screen readers (WAI-ARIA APG Dialog pattern) on the native dialog element - name, initial focus, inert background, Escape, focus return. Use when adding a modal, popup, drawer, lightbox, cookie or confirm dialog in any stack, or when asked "make this modal accessible".
globs: **/*.html, **/*.jsx, **/*.tsx, **/*.vue, **/*.svelte, **/*.astro, **/*.component.html
alwaysApply: false
---

# Dialogs and modals (frontend-skills)

- Use `<dialog>` with `showModal()` for modals and `show()` for non-modal ones, not a `div role="dialog"` (a11y/dialog-native).
- Every dialog has a name: `aria-labelledby` pointing at its visible heading (a11y/dialog-name).
- On open, focus goes inside; Tab stays inside a modal; Escape closes; on close, focus returns to the trigger (a11y/dialog-focus).
- The page behind a modal is inert, never just `aria-hidden` over focusable content (a11y/aria-hidden-focusable).
- Only an open modal keeps focus inside; a closed one releases it (a11y/no-keyboard-trap).
- A visible close or cancel button is inside the dialog and in the Tab order.
- Confirmations of destructive actions use `role="alertdialog"` with `aria-describedby` on the message, and focus the safe choice.
- Do not open a modal on page load or on hover; open it from a user action.

Before larger changes, read the full skill: `.agents/skills/fe-a11y-dialog/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: GitHub Copilot

  • .agents/skills/fe-a11y-dialog/SKILL.mdskill
  • .agents/skills/fe-a11y-dialog/references/dialog.mdskill
  • .github/instructions/fe-a11y-dialog.instructions.mdplik reguł
  • AGENTS.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

.github/instructions/fe-a11y-dialog.instructions.md
---
applyTo: "**/*.html,**/*.jsx,**/*.tsx,**/*.vue,**/*.svelte,**/*.astro,**/*.component.html"
description: "Builds modal and non-modal dialogs, alert dialogs, drawers and confirmations that work with keyboard and screen readers (WAI-ARIA APG Dialog pattern) on the native dialog element - name, initial focus, inert background, Escape, focus return. Use when adding a modal, popup, drawer, lightbox, cookie or confirm dialog in any stack, or when asked \"make this modal accessible\"."
---

# Dialogs and modals (frontend-skills)

- Use `<dialog>` with `showModal()` for modals and `show()` for non-modal ones, not a `div role="dialog"` (a11y/dialog-native).
- Every dialog has a name: `aria-labelledby` pointing at its visible heading (a11y/dialog-name).
- On open, focus goes inside; Tab stays inside a modal; Escape closes; on close, focus returns to the trigger (a11y/dialog-focus).
- The page behind a modal is inert, never just `aria-hidden` over focusable content (a11y/aria-hidden-focusable).
- Only an open modal keeps focus inside; a closed one releases it (a11y/no-keyboard-trap).
- A visible close or cancel button is inside the dialog and in the Tab order.
- Confirmations of destructive actions use `role="alertdialog"` with `aria-describedby` on the message, and focus the safe choice.
- Do not open a modal on page load or on hover; open it from a user action.

Before larger changes, read the full skill: `.agents/skills/fe-a11y-dialog/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Gemini CLI

  • .agents/skills/fe-a11y-dialog/SKILL.mdskill
  • .agents/skills/fe-a11y-dialog/references/dialog.mdskill
  • GEMINI.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Gemini CLI: Gemini CLI was replaced by Antigravity CLI for unpaid tiers on 2026-06-18; choose "antigravity" too if you use it.

Gemini CLI nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

GEMINI.md
## Front-end work (frontend-skills)

- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Antigravity CLI

  • .agents/skills/fe-a11y-dialog/SKILL.mdskill
  • .agents/skills/fe-a11y-dialog/references/dialog.mdskill
  • .agents/rules/fe-a11y-dialog.mdplik reguł
  • AGENTS.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

.agents/rules/fe-a11y-dialog.md
---
trigger: glob
globs: "**/*.html, **/*.jsx, **/*.tsx, **/*.vue, **/*.svelte, **/*.astro, **/*.component.html"
description: "Builds modal and non-modal dialogs, alert dialogs, drawers and confirmations that work with keyboard and screen readers (WAI-ARIA APG Dialog pattern) on the native dialog element - name, initial focus, inert background, Escape, focus return. Use when adding a modal, popup, drawer, lightbox, cookie or confirm dialog in any stack, or when asked \"make this modal accessible\"."
---

# Dialogs and modals (frontend-skills)

- Use `<dialog>` with `showModal()` for modals and `show()` for non-modal ones, not a `div role="dialog"` (a11y/dialog-native).
- Every dialog has a name: `aria-labelledby` pointing at its visible heading (a11y/dialog-name).
- On open, focus goes inside; Tab stays inside a modal; Escape closes; on close, focus returns to the trigger (a11y/dialog-focus).
- The page behind a modal is inert, never just `aria-hidden` over focusable content (a11y/aria-hidden-focusable).
- Only an open modal keeps focus inside; a closed one releases it (a11y/no-keyboard-trap).
- A visible close or cancel button is inside the dialog and in the Tab order.
- Confirmations of destructive actions use `role="alertdialog"` with `aria-describedby` on the message, and focus the safe choice.
- Do not open a modal on page load or on hover; open it from a user action.

Before larger changes, read the full skill: `.agents/skills/fe-a11y-dialog/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Devin / Windsurf

  • .agents/skills/fe-a11y-dialog/SKILL.mdskill
  • .agents/skills/fe-a11y-dialog/references/dialog.mdskill
  • .devin/rules/fe-a11y-dialog.mdplik reguł
  • AGENTS.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Devin / Windsurf: Devin CLI also reads .cursor/rules; with Cursor chosen too, the CLI sees both rule files of a skill.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

.devin/rules/fe-a11y-dialog.md
---
trigger: glob
globs: "**/*.html,**/*.jsx,**/*.tsx,**/*.vue,**/*.svelte,**/*.astro,**/*.component.html"
---

# Dialogs and modals (frontend-skills)

Builds modal and non-modal dialogs, alert dialogs, drawers and confirmations that work with keyboard and screen readers (WAI-ARIA APG Dialog pattern) on the native dialog element - name, initial focus, inert background, Escape, focus return. Use when adding a modal, popup, drawer, lightbox, cookie or confirm dialog in any stack, or when asked "make this modal accessible".

- Use `<dialog>` with `showModal()` for modals and `show()` for non-modal ones, not a `div role="dialog"` (a11y/dialog-native).
- Every dialog has a name: `aria-labelledby` pointing at its visible heading (a11y/dialog-name).
- On open, focus goes inside; Tab stays inside a modal; Escape closes; on close, focus returns to the trigger (a11y/dialog-focus).
- The page behind a modal is inert, never just `aria-hidden` over focusable content (a11y/aria-hidden-focusable).
- Only an open modal keeps focus inside; a closed one releases it (a11y/no-keyboard-trap).
- A visible close or cancel button is inside the dialog and in the Tab order.
- Confirmations of destructive actions use `role="alertdialog"` with `aria-describedby` on the message, and focus the safe choice.
- Do not open a modal on page load or on hover; open it from a user action.

Before larger changes, read the full skill: `.agents/skills/fe-a11y-dialog/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: OpenCode

  • .agents/skills/fe-a11y-dialog/SKILL.mdskill
  • .agents/skills/fe-a11y-dialog/references/dialog.mdskill
  • AGENTS.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

OpenCode nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

AGENTS.md
## Front-end work (frontend-skills)

- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Cline

  • .claude/skills/fe-a11y-dialog/SKILL.mdskill
  • .claude/skills/fe-a11y-dialog/references/dialog.mdskill
  • .clinerules/fe-a11y-dialog.mdplik reguł
  • AGENTS.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Cline: If .clinerules is a single file rather than a folder, Cline rule files are not written; skills still are.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

.clinerules/fe-a11y-dialog.md
---
paths:
  - "**/*.html"
  - "**/*.jsx"
  - "**/*.tsx"
  - "**/*.vue"
  - "**/*.svelte"
  - "**/*.astro"
  - "**/*.component.html"
---

# Dialogs and modals (frontend-skills)

Builds modal and non-modal dialogs, alert dialogs, drawers and confirmations that work with keyboard and screen readers (WAI-ARIA APG Dialog pattern) on the native dialog element - name, initial focus, inert background, Escape, focus return. Use when adding a modal, popup, drawer, lightbox, cookie or confirm dialog in any stack, or when asked "make this modal accessible".

- Use `<dialog>` with `showModal()` for modals and `show()` for non-modal ones, not a `div role="dialog"` (a11y/dialog-native).
- Every dialog has a name: `aria-labelledby` pointing at its visible heading (a11y/dialog-name).
- On open, focus goes inside; Tab stays inside a modal; Escape closes; on close, focus returns to the trigger (a11y/dialog-focus).
- The page behind a modal is inert, never just `aria-hidden` over focusable content (a11y/aria-hidden-focusable).
- Only an open modal keeps focus inside; a closed one releases it (a11y/no-keyboard-trap).
- A visible close or cancel button is inside the dialog and in the Tab order.
- Confirmations of destructive actions use `role="alertdialog"` with `aria-describedby` on the message, and focus the safe choice.
- Do not open a modal on page load or on hover; open it from a user action.

Before larger changes, read the full skill: `.claude/skills/fe-a11y-dialog/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Zed

  • .agents/skills/fe-a11y-dialog/SKILL.mdskill
  • .agents/skills/fe-a11y-dialog/references/dialog.mdskill
  • CLAUDE.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Zed: Zed reads only the first instruction file of its list; the block is placed in that file.

Zed nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

CLAUDE.md
## Front-end work (frontend-skills)

- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: JetBrains Junie

  • .agents/skills/fe-a11y-dialog/SKILL.mdskill
  • .agents/skills/fe-a11y-dialog/references/dialog.mdskill
  • AGENTS.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

JetBrains Junie: Junie reads .agents/skills only in a trusted project.

JetBrains Junie nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

AGENTS.md
## Front-end work (frontend-skills)

- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Kiro

  • .kiro/skills/fe-a11y-dialog/SKILL.mdskill
  • .kiro/skills/fe-a11y-dialog/references/dialog.mdskill
  • .kiro/steering/fe-a11y-dialog.mdplik reguł
  • AGENTS.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

.kiro/steering/fe-a11y-dialog.md
---
inclusion: fileMatch
fileMatchPattern: ["**/*.html", "**/*.jsx", "**/*.tsx", "**/*.vue", "**/*.svelte", "**/*.astro", "**/*.component.html"]
---

# Dialogs and modals (frontend-skills)

Builds modal and non-modal dialogs, alert dialogs, drawers and confirmations that work with keyboard and screen readers (WAI-ARIA APG Dialog pattern) on the native dialog element - name, initial focus, inert background, Escape, focus return. Use when adding a modal, popup, drawer, lightbox, cookie or confirm dialog in any stack, or when asked "make this modal accessible".

- Use `<dialog>` with `showModal()` for modals and `show()` for non-modal ones, not a `div role="dialog"` (a11y/dialog-native).
- Every dialog has a name: `aria-labelledby` pointing at its visible heading (a11y/dialog-name).
- On open, focus goes inside; Tab stays inside a modal; Escape closes; on close, focus returns to the trigger (a11y/dialog-focus).
- The page behind a modal is inert, never just `aria-hidden` over focusable content (a11y/aria-hidden-focusable).
- Only an open modal keeps focus inside; a closed one releases it (a11y/no-keyboard-trap).
- A visible close or cancel button is inside the dialog and in the Tab order.
- Confirmations of destructive actions use `role="alertdialog"` with `aria-describedby` on the message, and focus the safe choice.
- Do not open a modal on page load or on hover; open it from a user action.

Before larger changes, read the full skill: `.kiro/skills/fe-a11y-dialog/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Augment

  • .agents/skills/fe-a11y-dialog/SKILL.mdskill
  • .agents/skills/fe-a11y-dialog/references/dialog.mdskill
  • AGENTS.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Augment nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

AGENTS.md
## Front-end work (frontend-skills)

- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Trae

  • .trae/skills/fe-a11y-dialog/SKILL.mdskill
  • .trae/skills/fe-a11y-dialog/references/dialog.mdskill
  • .trae/rules/fe-a11y-dialog.mdplik reguł
  • AGENTS.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Trae: Trae reads AGENTS.md only after it is enabled in its settings.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

.trae/rules/fe-a11y-dialog.md
---
description: "Builds modal and non-modal dialogs, alert dialogs, drawers and confirmations that work with keyboard and screen readers (WAI-ARIA APG Dialog pattern) on the native dialog element - name, initial focus, inert background, Escape, focus return. Use when adding a modal, popup, drawer, lightbox, cookie or confirm dialog in any stack, or when asked \"make this modal accessible\"."
globs: **/*.html,**/*.jsx,**/*.tsx,**/*.vue,**/*.svelte,**/*.astro,**/*.component.html
alwaysApply: false
---

# Dialogs and modals (frontend-skills)

- Use `<dialog>` with `showModal()` for modals and `show()` for non-modal ones, not a `div role="dialog"` (a11y/dialog-native).
- Every dialog has a name: `aria-labelledby` pointing at its visible heading (a11y/dialog-name).
- On open, focus goes inside; Tab stays inside a modal; Escape closes; on close, focus returns to the trigger (a11y/dialog-focus).
- The page behind a modal is inert, never just `aria-hidden` over focusable content (a11y/aria-hidden-focusable).
- Only an open modal keeps focus inside; a closed one releases it (a11y/no-keyboard-trap).
- A visible close or cancel button is inside the dialog and in the Tab order.
- Confirmations of destructive actions use `role="alertdialog"` with `aria-describedby` on the message, and focus the safe choice.
- Do not open a modal on page load or on hover; open it from a user action.

Before larger changes, read the full skill: `.trae/skills/fe-a11y-dialog/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Continue

  • .frontend-skills/skills/fe-a11y-dialog/SKILL.mdskill
  • .frontend-skills/skills/fe-a11y-dialog/references/dialog.mdskill
  • .continue/rules/fe-a11y-dialog.mdplik reguł

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

.continue/rules/fe-a11y-dialog.md
---
name: "Dialogs and modals"
description: "Builds modal and non-modal dialogs, alert dialogs, drawers and confirmations that work with keyboard and screen readers (WAI-ARIA APG Dialog pattern) on the native dialog element - name, initial focus, inert background, Escape, focus return. Use when adding a modal, popup, drawer, lightbox, cookie or confirm dialog in any stack, or when asked \"make this modal accessible\"."
globs: ["**/*.html", "**/*.jsx", "**/*.tsx", "**/*.vue", "**/*.svelte", "**/*.astro", "**/*.component.html"]
alwaysApply: false
---

# Dialogs and modals (frontend-skills)

- Use `<dialog>` with `showModal()` for modals and `show()` for non-modal ones, not a `div role="dialog"` (a11y/dialog-native).
- Every dialog has a name: `aria-labelledby` pointing at its visible heading (a11y/dialog-name).
- On open, focus goes inside; Tab stays inside a modal; Escape closes; on close, focus returns to the trigger (a11y/dialog-focus).
- The page behind a modal is inert, never just `aria-hidden` over focusable content (a11y/aria-hidden-focusable).
- Only an open modal keeps focus inside; a closed one releases it (a11y/no-keyboard-trap).
- A visible close or cancel button is inside the dialog and in the Tab order.
- Confirmations of destructive actions use `role="alertdialog"` with `aria-describedby` on the message, and focus the safe choice.
- Do not open a modal on page load or on hover; open it from a user action.

Before larger changes, read the full skill: `.frontend-skills/skills/fe-a11y-dialog/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Amazon Q Developer

  • .frontend-skills/skills/fe-a11y-dialog/SKILL.mdskill
  • .frontend-skills/skills/fe-a11y-dialog/references/dialog.mdskill
  • .amazonq/rules/frontend-skills.mdblok instrukcji

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Amazon Q Developer: Amazon Q Developer IDE plugins reach end of support on 2027-04-30; AWS points to Kiro.

Amazon Q Developer nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

.amazonq/rules/frontend-skills.md
## Front-end work (frontend-skills)

- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.

### Skills

- `fe-a11y-dialog` (Dialogs and modals): when editing `**/*.html`, `**/*.jsx`, `**/*.tsx`, `**/*.vue`, `**/*.svelte`, `**/*.astro`, `**/*.component.html`, first read `.frontend-skills/skills/fe-a11y-dialog/SKILL.md`.
Prawdziwy plik

Gdzie trafia fe-a11y-dialog dla: Aider

  • .frontend-skills/skills/fe-a11y-dialog/SKILL.mdskill
  • .frontend-skills/skills/fe-a11y-dialog/references/dialog.mdskill
  • CONVENTIONS.mdblok instrukcji
  • .aider.conf.ymlkonfiguracja

Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.

Aider nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.

Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.

CONVENTIONS.md
## Front-end work (frontend-skills)

- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.

### Skills

- `fe-a11y-dialog` (Dialogs and modals): when editing `**/*.html`, `**/*.jsx`, `**/*.tsx`, `**/*.vue`, `**/*.svelte`, `**/*.astro`, `**/*.component.html`, first read `.frontend-skills/skills/fe-a11y-dialog/SKILL.md`.
Prawdziwy plik

Jak go używać

Po instalacji agent sam ładuje skill, gdy zadanie pasuje do jego opisu. Możesz też poprosić o niego własnymi słowami, na przykład:

Frazy z opisu skilla, po których agent go wybiera (po angielsku, jak w skillu):

  • make this modal accessible

A żeby sprawdzić i poprawić pracę:

  • Użyj skilla fe-a11y-dialog na tym pliku.
  • Uruchom audyt front-endu na moich zmianach i popraw wszystko, co poważne.
  • Wyjaśnij a11y/dialog-native i popraw to tutaj.

Reguły, których uczy

  • a11y/dialog-native

    Build dialogs on the native <dialog> element opened with showModal() rather than a div with role="dialog".

    drobnastatyczneWCAG 2.4.3, 4.1.2

  • a11y/dialog-name

    Every dialog has an accessible name, usually aria-labelledby pointing at its visible heading.

    poważnastatyczneWCAG 4.1.2

  • a11y/dialog-focus

    A modal moves focus inside on open, keeps Tab inside, closes on Escape, and returns focus to the control that opened it.

    poważnaręczneWCAG 2.4.3, 2.1.2

  • a11y/aria-hidden-focusable

    aria-hidden="true" is never on a focusable element or on an element that contains one.

    poważnastatyczneWCAG 4.1.2

  • a11y/no-keyboard-trap

    Keyboard focus can always leave a component with Tab, Shift+Tab or Escape; only an open modal keeps focus inside.

    krytycznaręczneWCAG 2.1.2

Skrót reguł

Ta część jest kopiowana do zawężonego pliku reguł każdego agenta, więc musi być zrozumiała sama w sobie:

  • Use <dialog> with showModal() for modals and show() for non-modal ones, not a div role="dialog" (a11y/dialog-native).
  • Every dialog has a name: aria-labelledby pointing at its visible heading (a11y/dialog-name).
  • On open, focus goes inside; Tab stays inside a modal; Escape closes; on close, focus returns to the trigger (a11y/dialog-focus).
  • The page behind a modal is inert, never just aria-hidden over focusable content (a11y/aria-hidden-focusable).
  • Only an open modal keeps focus inside; a closed one releases it (a11y/no-keyboard-trap).
  • A visible close or cancel button is inside the dialog and in the Tab order.
  • Confirmations of destructive actions use role="alertdialog" with aria-describedby on the message, and focus the safe choice.
  • Do not open a modal on page load or on hover; open it from a user action.

Kroki, które wykonuje agent

  1. Check the project's UI library first (Radix, React Aria, Reka UI, bits-ui, Angular CDK Dialog, Headless UI): if it provides a dialog, use it the documented way instead of writing one.
  2. Otherwise write <dialog aria-labelledby="id"> with a heading, content and a <form method="dialog"> for the close buttons; open it from a <button type="button"> with showModal().
  3. Set initial focus with autofocus on the right element inside the dialog: the first field, or the least destructive button.
  4. Keep the trigger in a variable and focus it in the close event if the browser did not.
  5. Style the overlay with ::backdrop; stop background scroll with body:has(dialog[open]) { overflow: hidden; }.
  6. For a side drawer or full-screen menu, use the same <dialog>; for a small popup next to its trigger without blocking the page, use popover.

Jak agent sprawdza swoją pracę

  • npx github:dawidolko/frontend-skills audit --changed finds unnamed dialogs, div dialogs and aria-hidden over focusable content.
  • By hand: open with the keyboard, Tab and Shift+Tab around (focus stays inside), press Escape (it closes, focus is back on the trigger), and listen with a screen reader (name and role are read on open).

Sprawdzane audytem

Testy statyczne tych reguł działają w audit; to prawdziwa sesja na przykładowym projekcie:

Nagranie terminala: audit wypisuje znaleziska według wagi z identyfikatorami reguł i miejscem plik:linia i kończy się błędem od progu serious.
audit: liczby według wagi, każda reguła z pierwszym miejscem, kod wyjścia.

Pliki referencyjne