Overlays
Dialog
Focuses a short task above the current page with managed focus.
Usage
Anatomy
The parts and how they nest, taken from the preview above.
Examples
Controlled open state
Keep open and onOpenChange together so Escape, dismissal, and application actions share one state.
Northstar launch
Review and edit the details of this project.
Recommendations
| Guidance | Practice |
|---|---|
| Do | Give the task a clear title. Keep the main action and cancel action visible and predictable. |
| Do | DialogTitle names the popup. DialogDescription supplies supporting context. Tab stays within a modal dialog; Escape closes it and returns focus to its trigger. |
| Do | An uncontrolled composition can live in a Server Component. Use a Client Component for open state and callbacks. Close after a save succeeds, not before. |
Usage boundaries
| Guidance | Boundary |
|---|---|
| Scope | Use Alert Dialog for critical confirmation. Move long, multi-step work to a page when the overlay obscures context. |
API reference
Public props from @mizen-labs/ui. Use exported prop types for the complete TypeScript contract.
| Prop | Type | Default | Description |
|---|---|---|---|
| | false | Controls whether the dialog is open. |
| | false | Sets the initial state when the dialog is uncontrolled. |
| | — | Receives open-state changes. |
| | — | Opens the dialog; accepts a render target. |
| | — | Provides the modal popup, backdrop, and viewport; size defaults to md. |
| | "md" | Selects one of the four popup width presets. |
| | true | Shows the built-in close button in the popup. |
| | <div> | Groups the title and description. |
| | — | Names the dialog for assistive technology. |
| | — | Provides the dialog's accessible description. |
| | <div> | Contains the dialog's main content. |
| | <div> | Groups closing or commit actions. |
| | — | Closes the dialog; accepts a render target. |