Component
Dialog
Modal overlay built on Radix UI. Traps focus, closes on Escape or backdrop click, animated slide-up entry.
Default
tsx
<Dialog>
<DialogTrigger asChild>
<Button variant="outline">Open Dialog</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Delete Photo</DialogTitle>
<DialogDescription>
This will permanently remove the photo.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose asChild>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button variant="destructive">Delete</Button>
</DialogFooter>
</DialogContent>
</Dialog>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | — | Controlled open state. |
| onOpenChange | (open: boolean) => void | — | Called when open state changes. |
| defaultOpen | boolean | false | Uncontrolled initial open state. |