dialog-demo
Installation
pnpm dlx shadcn@latest add https://ui.n2020.com/r/dialog.jsonUsage
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";<Dialog>
<DialogTrigger render={<Button variant="outline" />}>Open</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Rename project</DialogTitle>
<DialogDescription>
The new name appears in the sidebar.
</DialogDescription>
</DialogHeader>
</DialogContent>
</Dialog>DialogTrigger and DialogClose take a render prop. They do not support asChild.
Examples
Close button in the footer
Set showCloseButton={false} on DialogContent to hide the corner button. Set showCloseButton on DialogFooter to add a Close button there.
dialog-close-button