Dialog
A modal dialog component for displaying content that requires user attention or interaction.
Install Dependencies
npx quickcode-ui add DialogSimple Dialog
Controlled Dialog
Props
Dialog
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Dialog content and sub-components |
open | boolean | — | Controlled open state |
defaultOpen | boolean | false | Initial open state for uncontrolled usage |
onOpenChange | (open: boolean) => void | — | Callback when open state changes |
Dialog.Trigger
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Trigger element |
asChild | boolean | false | Merge props with child element |
className | string | — | Additional CSS classes |
Dialog.Content
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Content to display in dialog |
showCloseButton | boolean | true | Show close button in top-right corner |
className | string | — | Additional CSS classes |
Dialog.Header
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Header content |
className | string | — | Additional CSS classes |
Dialog.Footer
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Footer content (typically actions) |
className | string | — | Additional CSS classes |
Dialog.Title
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Dialog title text |
className | string | — | Additional CSS classes |
Dialog.Description
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Dialog description text |
className | string | — | Additional CSS classes |
Dialog.Close
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Close trigger element |
asChild | boolean | false | Merge props with child element |
className | string | — | Additional CSS classes |
Dialog.Action
| Prop | Type | Default | Description |
|---|---|---|---|
onClick | (e: React.MouseEvent<HTMLButtonElement>) => void | — | Action handler (supports async, auto-closes in uncontrolled mode) |
Inherits all Button props including isloading, variant, size, disabled, etc. |
Last updated on