- Docs
- Components
- 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
| Keys | What happens |
|---|---|
| EnterSpace | On its trigger: opens it. |
| TabTab | Moves through the dialog; focus stays inside while it's open. |
| Escape | Closes 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