ARIA States & Properties

aria-modal

Indicates a dialog is modal, with content outside it unavailable for interaction. It does not enforce modality, trap focus or hide surrounding content on its own. Only set true when behavior really is modal; prefer native showModal(). Value type: boolean. Accepted values: true, false. Default or omitted behavior: false. Applicable context: dialog, alertdialog; example uses native modality. The example intentionally uses a native HTML equivalent. Use only where allowed for the element’s implicit or explicit role. ARIA describes accessibility semantics; it does not automatically implement the associated behavior. Test with the relevant browser and assistive technology.

Formal Syntax & Structure

html syntaxhtml
aria-modal="value" (replace value with a valid value; example uses preferred alternative)

Parameters & Attributes

NameTypeDescription
aria-modalbooleanAccepted values: true, false. Default or omitted behavior: false. Context: dialog, alertdialog; example uses native modality. Requiredness depends on the role.

Working Example

Example Snippethtml
<button id="show">Open</button><dialog id="d" aria-label="Settings">  <form method="dialog">    <button>Close</button>  </form></dialog><script>  document.getElementById('show').onclick=()=>document.getElementById('d').showModal()</script>
HTML Reference