Components
AlertDialog
Modal confirmation dialog that interrupts the user for a decision that can't
be dismissed by clicking outside - use for destructive or irreversible
actions. Open state is controlled (open) or uncontrolled (defaultOpen);
compose with AlertDialogTrigger and AlertDialogContent.
Usage
Best practices
Use
AlertDialogonly for a confirm / warn / destructive decision (Cancel + Action); a general modal form or details view is aDialog.Route every destructive confirmation here, never a plain
Dialog- unlikeDialogit won't dismiss on outside-click / Esc, so the choice stays deliberate.Give the destructive
AlertDialogActiontone="danger"and keep the safe escape asAlertDialogCancel.
Props
AlertDialogAction
AlertDialogCancel
AlertDialogContent
AlertDialogDescription
AlertDialogOverlay
AlertDialogTitle
Also exports
- component
AlertDialog - component
AlertDialogFooter - component
AlertDialogHeader - component
AlertDialogPortal - component
AlertDialogTrigger