Favorites

ARIA dialog Role

dialog
ARIA Window RoleThis ARIA role is supported by all modern browsers.
Updated 28th November 2026

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.

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee

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

<button type="button" onclick="document.getElementById('dl').showModal()">Sign in</button>
<dialog id="dl" aria-labelledby="dl-t">
<h2 id="dl-t">Sign in</h2>
<form method="dialog">
<label for="u">Email</label> <input id="u" type="email">
<button>Close</button>
</form>
</dialog>

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.

This ARIA role is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee