Overview
Dialog interrupts the current page to focus attention on a decision, short task, or critical information that must be addressed before returning.
Focused task
A clear trigger opens a dialog with a specific title, concise body, and outcome-based actions.
Anatomy
A dialog combines a modal backdrop, labelled panel, optional media or status icon, body content, close affordance, and footer actions.
- 1BackdropRequired
Separates the modal task from the inactive page.
- 2HeaderRequired
Provides the accessible title, optional subtitle, and close action.
- 3BodyRequired
Contains the message, form, or focused task content.
- 4Footer
Groups primary and secondary outcomes in a predictable order.
When to use
Use a dialog when the current workflow cannot safely continue without a response or focused subtask.
Recommended
- Confirm consequential actions
Ask for confirmation when an action is destructive, costly, or difficult to reverse.
- Complete a short focused task
Use for compact forms or decisions that preserve the underlying page context.
- Communicate blocking information
Use when people must acknowledge or resolve a condition before continuing.
When not to use
Avoid modal interruption for information or work that belongs in the normal page flow.
Avoid
- Do not use for passive status
Use Alert, Toast, or inline feedback when no immediate decision is required.
- Do not use for long workflows
Use a dedicated page when the task contains many fields, steps, or reference material.
- Do not stack dialogs
Close or replace the current dialog before opening another modal surface.
Variants
Type communicates intent; position and size adapt the surface to the amount and structure of content.
Centered
Default for confirmations, alerts, and short forms.
Bottom drawer
Supports touch-oriented choices or compact mobile tasks.
Side panel
Supports contextual detail or editing with more vertical space.
Intent types
Default, destructive, success, warning, and info reinforce the message.
States
Dialog state includes entry, focus containment, validation or progress inside the task, and a clear exit path.
| State | Trigger | Visual response | Interaction |
|---|---|---|---|
| Closed | No modal task is active | Underlying page is available | Trigger can open the dialog |
| Opening | open becomes true | Backdrop and panel enter | Initial focus moves inside |
| Open | Panel is active | Page is visually de-emphasized | Focus remains within the dialog |
| Validation | Submitted content is invalid | Inline field feedback | Dialog stays open for correction |
| Submitting | Async action is running | Progress and disabled duplicate action | Dismissal follows the operation policy |
| Closing | Action, close, Escape, or backdrop | Panel exits | Focus returns to the opener |
Behavior
Opening a dialog moves focus into it, locks background scrolling, and prevents interaction with the underlying page until dismissal.
Initial focus
Focus the safest useful control; avoid placing focus on a destructive primary action.
Focus containment
Tab and Shift+Tab cycle through controls inside the active panel.
Dismissal
Escape, backdrop, close button, and actions follow the configured dismissal policy.
Focus return
After close, restore focus to the element that opened the dialog.
Accessibility
Dialog exposes modal semantics, an accessible name, an optional description, contained focus, and predictable keyboard dismissal.
| Key | Action |
|---|---|
| Tab | Moves to the next focusable control within the dialog. |
| ShiftTab | Moves to the previous focusable control within the dialog. |
| Esc | Closes the dialog when closeOnEscape is enabled. |
| EnterSpace | Activates the focused action. |
- Provide a concise title for every dialog.
- Keep focus inside while the dialog is open.
- Return focus to the opening control after close.
- Do not rely on backdrop click as the only dismissal method.
- Keep destructive and cancel actions clearly distinguishable.
- Describe meaningful hero images and leave decorative images with empty alt text.
Content guidelines
Dialog copy should explain why attention is required and what each available outcome will do.
State the task
Use a short title that names the decision or outcome.
Delete workspace?
Explain consequences
Put essential context and irreversible effects in the body.
This permanently deletes 14 projects.
Label outcomes
Use specific verbs for primary actions and plain “Cancel” for the safe exit.
Delete workspace
Avoid redundant close choices
Do not present multiple actions that produce the same result unless the platform convention requires them.
Cancel
Examples
Examples cover alert intent, form and image composition, alternative positions, multi-step tasks, and command-palette behavior.
Alert types
type prop sets the icon and color scheme — default, destructive, success, warning
Form + image header
Form dialog with Input fields; imageSrc places a hero banner at the top
Positions
bottom = bottom drawer · right = side panel · size=fullscreen fills the viewport
Multi-step
Step indicator + back/next footer — built with a single step state
Command palette
⌘K-style search overlay — built with Dialog + search input + command items
Props / API
Dialog is controlled through open and onClose; dismissal, position, size, intent, media, and footer composition are configurable.
Props