Playground
Title
Size
Tab cycles within the dialog while it's open (focus never escapes to the page behind it), and returns to whatever triggered the modal once it closes.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | — | Controlled — the Modal renders nothing when false. |
| onClose | () => void | — | Called on Escape, backdrop click, or the close button. |
| title | string | — | Optional heading shown next to the close button. |
| size | "sm" | "md" | "lg" | "fullscreen" | "md" | Controls the dialog's max-width (384 / 448 / 672px); fullscreen fills the viewport. |
| children | ReactNode | — | Modal body content. |
Usage Guidelines
When to use
- Use for focused, blocking tasks that need a decision before returning to the page — confirmations, short forms.
- Use size="lg" or "fullscreen" for content-heavy forms; keep the sm/md default for confirmations and short single-field edits.
When not to use
- Don't use Modal for long-form content or multi-step flows that need their own URL/history state — Modal has no URL state, so back/forward and deep-linking don't work inside it.
- Don't stack a Modal on top of another Modal.