Dialog / Modal — Accessibility Specification

WCAG 2.1 AA • AODA compliant • Updated 2025-10-28


What is this component?

What is this component? A dialog is a modal window that captures focus for a short task. It must trap focus within, restore focus on close, and be announced to AT.

Accessibility Requirements

RequirementWCAG CriteriaDescription
Focus management2.4.3, 2.4.7Move focus to dialog on open; keep focus inside; return focus to trigger on close.
Keyboard support2.1.1Esc closes; Tab/Shift+Tab cycle within.
Name/Role4.1.2Announce dialog role and label; describe purpose.

ARIA Roles and Attributes

ARIA Role/AttributeUsed OnPurpose & Usage
<dialog> + aria-labelledby/aria-describedbyNative dialogUse showModal(), ensure focus trapping and labeled title.
role="dialog" or alertdialogCustom modalTrap focus; use backdrop; restore focus on close.

Implementation Guidelines




  

Confirm delete

This action cannot be undone.

DO’s

Don’ts

Common Pitfalls

Testing Checklist

Test ItemWCAG CriteriaPass Criteria
Role/Label4.1.2AT announces “dialog” with title.
Focus trap2.1.1, 2.4.3Tab cycles within; background is inert.
Escape closes2.1.1Esc closes reliably.