Dialog

Shadcn compatible modal dialog on Base UI with a blurred backdrop, enter and exit animation, close button, header, title, description and a footer bar.

src/registry/ui/dialog.tsx/r/dialog.json

Basic

Installation#

bash
npx shadcn@latest add @minidev/dialog

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/dialog.json

Usage#

tsx
import { Dialog } from "@/components/ui/dialog"

export function Example() {
  return (
    <Dialog>
      <DialogTrigger className={cn(buttonVariants())}>Open dialog</DialogTrigger>
      <DialogContent>
        <DialogHeader>
          <DialogTitle>Confirm delete</DialogTitle>
          <DialogDescription>This cannot be undone.</DialogDescription>
        </DialogHeader>
        <DialogFooter>
          <Button variant="outline">Cancel</Button>
          <Button variant="destructive">Delete</Button>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  )
}

API reference#

Also accepts every prop of DialogPrimitive.Root props, passed through to the root element.

Dependencies#

npm

@base-ui/reactlucide-react

Built from

Examples#

All dialog, drawer and popover components

Learn more