Components
A modal dialog built on Base UI — accessible trigger, overlay, header, body panel and footer, with a smooth center-zoom open animation.
Loading preview...
"use client";
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogClose,
DialogContent,
DialogFooter,
DialogHeader,
DialogPanel,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
export default function Default() {
return (
<div className="flex min-h-screen w-full items-center justify-center bg-background p-8">
<Dialog>
<DialogTrigger render={<Button variant="outline">Move to Trash</Button>} />
<DialogContent className="w-[28rem] max-w-[calc(100vw-2rem)]">
<DialogHeader>
<DialogTitle>Move to Trash</DialogTitle>
</DialogHeader>
<DialogPanel>
<p className="text-sm text-muted-foreground">
“demo.docx” will be moved to the Trash. You can restore it later
from there.
</p>
</DialogPanel>
<DialogFooter>
<DialogClose render={<Button variant="outline">Cancel</Button>} />
<DialogClose render={<Button>Move to Trash</Button>} />
</DialogFooter>
</DialogContent>
</Dialog>
</div>
);
}