Dialog
A titled panel that takes focus: modal over an inert page, or non-modal in the page flow. Focus returns to its trigger on close.
Use cases
People using assistive technology should be able to:
- Hear the dialog's title, and its description when there is one, as soon as it opens.
- Close it with Escape or the Close button and land back on the control that opened it.
- Reach every control in the dialog with Tab, without reaching the page behind a modal dialog.
- Start on the safe choice, such as Cancel, when the action can't be undone.
Reading order
The title names the dialog and the description is read with it, so write the title as the question or task ("Remove this course?"). The Close button is labelled for you and comes right after the title.
Keyboard and focus
Escape and the Close button close the dialog, and focus goes back to the control that opened it. Focus starts on the title; to start on Cancel instead, mark it data-autofocus, never with React's autoFocus.
Every component follows ADR-025, ADR-026 and ADR-028(states, prop vocabulary, focus indicator); they are not repeated per component.