On this page
Overview
Show code, ProjectDetails.tsx
Variants
Placement
- Centered
Confirmations, short forms and details. The default.
- Near the top
Search-like tasks, whose results grow down from a fixed field.
Show code, FindPlan.tsx
Widths
Both narrow to fit the window.
- Medium
Most dialogs. The default.
- Large
Tables, comparisons and longer forms.
Show code, ReviewChanges.tsx
Anatomy
Dialog
Title
Description
Content
Close button
Action
Show code, DialogAnatomy.tsx
Behaviour
Actions
A dialog's actions end with the primary one, after a built-in close button. A Cancel of your own is a secondary Button, as that close button is.
Pending work
While its work runs, nothing closes the dialog. Its close buttons are disabled, and its primary action shows the work running.
- Submit a form from its primary action, so Enter in a field submits it too.
Show code, RenameProject.tsx
Closing actions
A DialogClose closes the dialog after doing its own work, such as Don’t save.
Show code, UnsavedChanges.tsx
Rules
One task per dialog, closed by its built-in button.
Use it when
- A decision before a consequence, such as deleting a project
- A short task that needs attention first, such as inviting a member
- Content that needs more room than a popup, such as a comparison
- A search-like task whose results grow below its field
Show code, CancelAsCloseLabel.tsx
Show code, ExtraCancelButton.tsx
Show code, InviteMember.tsx
Show code, ErrorInSecondDialog.tsx
Accessibility
| Key | Action |
|---|---|
| Tab, Shift+Tab | Moves through the dialog; a modal dialog keeps focus inside. |
| Esc | Closes the dialog, or first what is open inside it. |
| Enter, Space | Presses the focused button; a close button returns focus. |