Dialog
primitiveModal overlay anchored to the viewport. Closes on Escape or backdrop click. Locks body scroll.
Installation
$pnpm dlx disenio add dialogUsage
example.tsx
import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter, DialogClose } from "@/components/ui/dialog";API
| Prop | Type | Default | Description |
|---|---|---|---|
| Dialog.open | boolean | — | Controlled open state. |
| Dialog.defaultOpen | boolean | false | Uncontrolled initial state. |
| Dialog.onOpenChange | (v: boolean) => void | — | Fires when open state changes. |
| DialogTrigger.asChild | boolean | — | Use the child as the trigger element instead of wrapping. |
| DialogClose.asChild | boolean | — | Same pattern for the close action. |