Alert Dialog
Modal dialog that interrupts the user with important content and requires an action
Preview
Installation
Usage
Examples
Controlled
Control the alert dialog open state programmatically.
Nested
Use nested alert dialogs for multi-step confirmations.
Detached Trigger
Place the trigger outside of the AlertDialog component using createAlertDialogHandle().
API Reference
The AlertDialog component is built on top of Base UI's AlertDialog. All Base UI props are supported. The documentation below only covers custom props specific to our implementation.
For the complete Base UI API, see the Base UI AlertDialog documentation.
Utilities
createAlertDialogHandle
Creates a handle that connects an alert dialog to one or more external AlertDialogTrigger components. Useful when the triggers need to live outside the AlertDialog — for example, when each row in a list has its own delete button but they all share one confirmation dialog.
Passing data from the trigger to the alert dialog
The handle accepts an optional <Payload> generic that types a value each trigger can pass along. The alert dialog reads it through a render-prop child, so you can render different content (or target different resources) per trigger without duplicating the dialog markup.
Without the <User> generic, payload inside the render prop resolves to unknown.
Props
AlertDialogContent
Modal container for important messages requiring user action. Composes AlertDialog.Portal, AlertDialog.Backdrop, and AlertDialog.Popup. Props are forwarded to AlertDialog.Popup.
AlertDialogBody
Scrollable content area within the alert dialog.
Notes
AlertDialogClose
Use AlertDialogClose with the render prop to create action buttons that close the dialog. Wraps Base UI's AlertDialog.Close.