Modal Dialog ARIA Pattern Checker

Paste a modal dialog HTML snippet and verify the required ARIA attributes

Ad placeholder (leaderboard)

Verify your modal dialog against the WAI-ARIA dialog pattern

A modal dialog is one of the easiest components to ship with broken accessibility. Sighted mouse users see a clean overlay, while screen reader users get a dialog with no name, no modal semantics, or a close button announced only as “button”. This checker parses a pasted snippet and reports, attribute by attribute, whether it matches the WAI-ARIA Authoring Practices dialog pattern.

How it works

The tool parses your HTML locally with the browser’s DOMParser, then runs five checks against the container that carries role="dialog", role="alertdialog", or a native <dialog> element:

  1. Dialog role — confirms a dialog container exists.
  2. aria-modal="true" — confirms the modal flag is set so the rest of the page is treated as inert.
  3. Accessible name — resolves aria-labelledby against the ids in the snippet (or accepts aria-label) and confirms the referenced heading actually has text.
  4. aria-describedby — optional; flagged as a recommendation when absent, validated when present.
  5. Close control — searches buttons and links inside the dialog for a close-like control that has an accessible name (visible text, aria-label, title, or a resolved aria-labelledby).

Each check returns PASS, FAIL, or WARN with a short explanation of exactly what was found.

Example and notes

A conformant skeleton looks like this:

<div role="dialog" aria-modal="true"
     aria-labelledby="dlg-title" aria-describedby="dlg-desc">
  <h2 id="dlg-title">Delete project?</h2>
  <p id="dlg-desc">This permanently removes the project.</p>
  <button type="button">Cancel</button>
  <button type="button">Delete</button>
  <button type="button" aria-label="Close dialog">&times;</button>
</div>

Two common failures the checker catches: an aria-labelledby that points to an id not present in the snippet, and a &times; close button with no aria-label, which a screen reader announces as just “button”. Remember that passing the static structure is necessary but not sufficient — always pair it with a real keyboard and screen reader pass for focus trapping and Escape handling.

Ad placeholder (rectangle)