ARIA dialog Role
The dialog role marks a window that appears over the page, such as a modal form or settings panel. The native dialog element has this role and handles focus for you.
Description
The dialog role identifies a dialog: a window, separate from the rest of the page, that asks the user for information or a response. Examples include a login form, a settings panel or an image lightbox. A dialog must have an accessible name, usually from its heading through aria-labelledby.
The <dialog> element has this role. Opened with showModal(), it is modal: it traps focus, makes the rest of the page inert, closes on Escape and returns focus when it closes. A custom dialog built from a <div> must do all of that in JavaScript and also needs aria-modal="true".
For an urgent message that needs confirmation, use alertdialog. For content that just appears near a control, such as a tooltip or a menu, use the matching role instead.
Use the native HTML <dialog> element where you can: it already has the dialog role, with the expected keyboard and browser behavior built in.
Properties
- Category
- Window
- HTML equivalent
<dialog>- Accessible name from
- author
- Required parent role
- None
- Required child roles
- None
ARIA Attributes
- Required
- None
- Supported
aria-modal- Prohibited
- None
- Global
- All global ARIA attributes can also be used, such as
aria-label,aria-labelledby,aria-describedby,aria-hidden.
Syntax
<element role="dialog">
Example
Browser Support
The following information will show you the current browser support for the dialog ARIA role. Hover over a browser icon to see the version that first introduced support for this ARIA role.
Desktop





Tablets & Mobile





