Alert Dialog

Shadcn style alert dialog on Base UI for confirmations that need an explicit answer. Modal backdrop, focus trap, title, description and an actions row.

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

Installation#

bash
npx shadcn@latest add @minidev/alert-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/alert-dialog.json

Usage#

tsx
import { AlertDialog } from "@/components/ui/alert-dialog"

export function Example() {
  return <AlertDialog />
}

API reference#

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

Dependencies#

npm

@base-ui/react

Built from

All dialog, drawer and popover components

Learn more