Semantics

A dialog is a descendant window of the primary window of a web application.

Additional info from the ARIA specification

For HTML pages, the primary application window is the entire web document.

Dialogs are often used to prompt the user to enter or respond to information, or can represent content related to understanding or modifying the content of the primary application window. A dialog that is designed to interrupt workflow and prevent users from interacting with the primary web application is usually modal. See related alertdialog. A dialog that allows for the user to switch between interacting with the content of the primary web application and the content the dialog is usually modeless (i.e., non-modal). In lieu of using robust host language features for marking content of the primary web application as inert, authors SHOULD use the aria-modal attribute, and constrain focus to dialogs. See the WAI-ARIA Authoring Practices: Dialog (modal) pattern for additional details on implementing modal dialog design patterns.

Authors SHOULD provide an accessible name for a dialog, which can be done with the aria-label or aria-labelledby attribute.

Authors SHOULD ensure that all dialogs (both modal and non-modal) have at least one focusable descendant element. Authors SHOULD focus an element in the modal dialog when it is displayed, and authors SHOULD constrain keyboard focus to focusable elements within a modal dialog, until dismissed.

Authors SHOULD provide a dialog an accessible description, with the aria-describedby attribute, for instances where authors have set initial keyboard focus on an element that follows content that outlines the purpose of the dialog. Assistive technology SHOULD give precedence to exposing author defined dialog accessible descriptions when a dialog is invoked and user focus is moved to a descendant of the dialog element.

Abstract Role

  • WindowRepresents an inner windows that is a child of the main web document.

Content Categories

  • Flow ContentAn element that structures and organizes the body of a web document.

Allowed Descendants

Flow Children Allowed

Usage

Allowed HTML elements

Implicit semantics

These elements have the role semantics by default, without needing to set the role attribute. Reach for elements with native semantics first when choosing how to implement a role in your content.

  • dialog

Explicitly allowed

  • section[role=dialog]

Elements that can have any role

  • abbr[role=dialog]
  • address[role=dialog]
  • b[role=dialog]
  • blockquote[role=dialog]
  • canvas[role=dialog]
  • cite[role=dialog]
  • code[role=dialog]
  • custom-element[role=dialog]
  • data[role=dialog]
  • del[role=dialog]
  • dfn[role=dialog]
  • div[role=dialog]
  • em[role=dialog]
  • figure[role=dialog]
  • i[role=dialog]
  • ins[role=dialog]
  • kbd[role=dialog]
  • mark[role=dialog]
  • output[role=dialog]
  • p[role=dialog]
  • pre[role=dialog]
  • q[role=dialog]
  • samp[role=dialog]
  • small[role=dialog]
  • span[role=dialog]
  • table[role=dialog]
  • tbody[role=dialog]
  • tfoot[role=dialog]
  • thead[role=dialog]
  • time[role=dialog]
  • u[role=dialog]
  • var[role=dialog]