Skip to main content
  1. Docs
  2. Components
  3. Overlays

Dialog

A focused decision or a short task, over the page. Danger and warning ask before something happens.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<div role="dialog">Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Keyboard

KeysWhat happens
EnterSpaceOn its trigger: opens it.
TabTabMoves through the dialog; focus stays inside while it's open.
EscapeCloses it, when it's dismissible; focus returns to the trigger.

02

Behaviour

Role and name
role="dialog", or "alertdialog" for warning and danger; named by its title, described by its description.
Focus on open
The first field, or else the footer's first, least destructive action: the close button comes last.
Focus on close
Back to the element that opened it.
Outside click
Closes a standard dialog; never an alert dialog.
Scrolling body
With nothing to focus in it, it takes focus, so it can be scrolled with the keys.

03

Tested

On every change, before it ships.

  • axe, WCAG 2.2 A and AA, in Chromium on every pull request
  • Firefox and WebKit every night
  • Focus: where it lands as it opens, and where it returns as it closes
  • Forced colours, reduced motion and right to left
Next — DialogChangelog