ConfirmDialogProps
The ConfirmDialogProps object is used to create a confirm dialog.
type ConfirmDialogProps = { isOpen?: boolean; allowHTML?: boolean; titleText: string; descriptionText?: string; confirmText?: string; cancelText?: string; confirmLabel?: string; onConfirm?: (event: React.MouseEvent<HTMLButtonElement>) => void; onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void; onOutside?: (event: React.MouseEvent<HTMLButtonElement>) => void;};Properties
| Property | Type | Description |
|---|---|---|
isOpen | boolean | undefined | Boolean to determine if the dialog should be opened. Defaults to true |
allowHTML | boolean | undefined | Whether to allow inline HTML in component text. Defaults to false |
titleText | string | Dialog title. Can be inline HTML if allowHTML is true |
descriptionText | string | undefined | Dialog description. Can be inline HTML if allowHTML is true |
confirmText | string | undefined | Confirm button text |
cancelText | string | undefined | Cancel button text |
confirmLabel | string | undefined | Confirm button aria-label |
onConfirm | (event: React.MouseEvent<HTMLButtonElement>) => void | undefined | Function to run when confirm button is clicked. The dialog does not close automatically, a handler must be included. |
onClose | (event: React.MouseEvent<HTMLButtonElement>) => void | undefined | Function to run when cancel button is clicked. The dialog does not close automatically, a handler must be included. |
onOutside | (event: React.MouseEvent<HTMLButtonElement>) => void | undefined | Function to run when dialog is clicked outside of. By default, this will run onClose.A handler must be included to close the dialog. |