Button with delay execute action.
npm i react-native-delay-button
import DelayButton from 'react-native-delay-button';
<DelayButton delayColorActive="#dc3545" customButtonStyle={{width: 250, alignSelf: 'center', textAlign: 'center'}} delayColorInactive="#28a745" buttonMessageInactive="Process" buttonMessageDelayCancel="Cancel action" actionOnClick={()=>Alert.alert('Execute Action')} DelayTime={5} />
Prop | Type | Default | Description |
---|---|---|---|
delayColorActive | String | Color when the delay started | |
delayColorInactive | String | Color when the button is not delayed | |
customButtonStyle | Object | Button Style | |
buttonMessageInactive | String | Text in the button when the button is not delayed | |
buttonMessageDelayCancel | String | Text when the delayed started | |
actionOnClick | Function | The function to execute when the delayed remain time is equal to 0 | |
DelayTime | Number | 0 | Delay seconds to started to execute the actionOnClick Function |