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
Related overlays components#
Command DialogCommand dialog that opens the command palette in a modal from a list of commands with labels and handlers. Wire it to a Cmd K shortcut in your React app.Confirm DestructiveDestructive action confirm: a red trigger button opens a dialog with a title, warning text, Cancel and Confirm. Labels are configurable for deletes and resets.Context MenuRight click context menu that opens at the cursor with menu items, including destructive items in red. Closes on selection or click outside, in React.DialogShadcn compatible modal dialog on Base UI with a blurred backdrop, enter and exit animation, close button, header, title, description and a footer bar.DrawerBottom drawer that slides a sheet up from the screen edge with a titled header, close button and scrolling body, capped at 80% of the viewport height.Dropdown MenuShadcn compatible dropdown menu on Base UI with groups, labels, checkbox and radio items, submenus, shortcuts, separators and destructive items.
All dialog, drawer and popover components