Sajari UI

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

NameTypeDefaultDescription
titlestringThe title of the dialog.
descriptionReactTextThe description of the dialog.
confirmLabelstring'Confirm'The label on the confirm action.
destructivebooleanfalseWhether the confirm action is destructive. If true, the confirm action button will use the danger appearance.
closeLabelstring'OK' or 'Cancel'The label on the close action. If onConfirm is specified, it's assumed as a confirm and the default becomes 'Cancel'.
onConfirmfunctionCallback function for when the user confirms the action.
onClosefunctionCallback function to close the toast.