- Docs
- Components
- Dialog
Dialog
A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.
Preview
Code
Installation
CLI
Manual
Anatomy
Single import
Multiple imports
Examples
Scrollable
Preview
Code
Alert Dialog
Use the role="alertdialog" prop on the <Dialog.Content> element to make an alert dialog.
Also, make sure to set the isDismissable prop to false on the <Dialog.Overlay> or <Dialog.Modal>
to prevent the dialog from being dismissed by clicking outside of it.
Preview
Code
Sheet
Use the side prop on the <Dialog.Modal> element to make a sheet dialog.
Preview
Code
API Reference
Root
| Prop | Type | Default |
|---|---|---|
defaultOpen | boolean | false |
isOpen | boolean | false |
onOpenChange | function |
Content
| Prop | Type | Default |
|---|---|---|
side | enum | "center" |
role | enum | "dialog" |
isBlurred | boolean | false |
isDismissable | boolean | true |
isKeyboardDismissDisabled | boolean | false |