react-confirmation-button
v0.2.1
Published
Confirmation button functionality
Downloads
5
Readme
npm install react-confirmation-button
component
import ConfirmButton from 'react-confirmation-button';
/* ... */
<ConfirmButton
onConfirm={() => action()}
onCancel={() => cancelAction()}
buttonText="Main button text"
confirmText="Confirm button text"
cancelText="Cancel button text"
loadingText="Loading button text (if `once` is set)"
wrapClass=""
buttonClass=""
mainClass=""
confirmClass=""
cancelClass=""
loadingClass=""
disabledClass=""
once
/>;
optional props (with their default values)
{
onCancel={() => {}}
confirmText: 'Confirm',
cancelText: 'Cancel',
buttonText: 'Save',
loadingText: 'Loading',
wrapClass: '',
buttonClass: '',
mainClass
confirmClass: '',
cancelClass: '',
loadingClass: '',
disabledClass: '',
once: true
}