AlertDialog
No consumersConfirm something destructive or irreversible before it happens.
For destructive or irreversible actions only. The value of a separate component is that it is hard to dismiss by accident and that its action button is explicit — if you are using it for an ordinary form, it should be a Dialog.
Default
Name the action in the button rather than saying “OK”. A reader who has skimmed the text should still be able to tell what the button will do.
Props
AlertDialog
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Controlled open state. |
defaultOpen | boolean | — | Uncontrolled initial state. |
onOpenChange | (open: boolean) => void | — | Called whenever it opens or closes. |
AlertDialogAction
| Prop | Type | Default | Description |
|---|---|---|---|
…ButtonProps | ButtonProps | variant="primary" | A Button. Pass `variant="danger"` for the destructive case. |