Properties
This is the list of the properties you can use in React Confirm Toast component.
Name | Value | Default | Required | Description |
---|---|---|---|---|
customFunction | Function | ✅ | Defines the function to confirm. | |
showConfirmToast | boolean | ✅ | A boolean React state that controls the toast. | |
setShowConfirmToast | React.Dispatch<React.SetStateAction<boolean>> | ✅ | The setState of the showConfirmToast state. | |
asModal | boolean | false | Toast will be displayed as a modal element, in the center of the viewport and darkening the background. | |
buttonCloseA11y | string | 'Close modal' | Sets the accessibility text for the buttonClose element. | |
buttonCloseAttributes | React.ButtonHTMLAttributes | Sets the HTML Button attributes to pass to the buttonClose element. | ||
buttonNoAttributes | React.ButtonHTMLAttributes | Sets the HTML Button attributes to pass to the buttonNo element. | ||
buttonNoText | string | 'Cancel' | Sets the cancel button message. | |
buttonYesAttributes | React.ButtonHTMLAttributes | Sets the HTML Button attributes to pass to the buttonYes element. | ||
buttonYesText | string | 'Ok' | Sets the confirm button message. | |
className | string | Adds a class to the element. | ||
position | 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right' | 'bottom-right' | Sets the toast position. It will be ignored if asModal is true . | |
showCloseIcon | boolean | true | Sets if the close icon is displayed. | |
theme | 'light' | 'dark' | 'snow' | 'lilac' | 'light' | Sets the toast style theme. | |
toastText | string | 'Do you want to continue?' | Sets the toast question text. |