AlertDialog
The AlertDialog component can be used to alert users via a dialog or to confirm actions.
Import
Usage
Editable Example
Confirm example
When a user is performing an action such as a delete, we may want to confirm they want to perform that action.
Editable Example
Props
Name | Type | Default | Description |
---|---|---|---|
title | string | The title of the dialog. | |
description | ReactText | The description of the dialog. | |
confirmLabel | string | 'Confirm' | The label on the confirm action. |
destructive | boolean | false | Whether the confirm action is destructive. If true, the confirm action button will use the danger appearance. |
closeLabel | string | 'OK' or 'Cancel' | The label on the close action. If onConfirm is specified, it's assumed as a confirm and the default becomes 'Cancel'. |
onConfirm | function | Callback function for when the user confirms the action. | |
onClose | function | Callback function to close the toast. |