A standalone , fully customizable Otp timer you can easily use.
npm install rn-otp-timerimport RnOtpTimer from 'rn-otp-timer';
<RnOtpTimer
minutes={0}
seconds={40}
resendButtonStyle={styles.button}
resendButtonTextStyle={styles.buttonText}
resendButtonAction={() => {
console.log('otp resent!');
}}
/>;| Parameter | Required | Description |
|---|---|---|
| minutes | No | Number of minutes for which the timer must be set |
| seconds | No | Number of seconds for which the timer must be set |
| resendButtonText | No | Set resend button text content |
| resendButtonAction | Yes | Callback when resend button is clicked |
| timerStyle | No | Props for styling timer content |
| resendButtonStyle | Yes | Props for styling resend button |
| resendButtonTextStyle | Yes | Props for styling resend button text |
To get started with the project, run yarn in the root directory to install the required dependencies for each package:
yarnWhile it's possible to use
npm, the tooling is built aroundyarn, so you'll have an easier time if you useyarnfor development.
While developing, you can run the example app to test your changes.
To run the example app on Android, go to example app directory and run:
yarn androidPull requests are welcome . For major changes, please open an issue first to discuss what you would like to change.