Dinachi

Alert Dialog

A modal dialog that interrupts the user with important content and expects a response. Ideal for confirmations and destructive actions.

View Source

#Installation

npx @dinachi/cli@latest add alert-dialog

#Usage

tsx
import {
  AlertDialog,
  AlertDialogTrigger,
  AlertDialogContent,
  AlertDialogViewport,
  AlertDialogPopup,
  AlertDialogBackdrop,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogAction,
  AlertDialogCancel,
} from '@/components/ui/alert-dialog'

#Examples

#API Reference

PropTypeDefaultDescription
openbooleanThe controlled open state of the alert dialog.
defaultOpenbooleanfalseThe initial open state for uncontrolled usage.
onOpenChange(open: boolean) => voidCallback fired when the open state changes.
AlertDialogPopup.initialFocusboolean | RefObject | functionElement to focus when the dialog opens.
AlertDialogPopup.finalFocusboolean | RefObject | functionElement to focus when the dialog closes.