1.1.5 • Published 4 years ago

otp-timer v1.1.5

Weekly downloads
146
License
-
Repository
github
Last release
4 years ago

otp-timer

Install

Install by executing either npm install otp-timer or yarn add otp-timer

Demo

react-otp-timer

Usage?

import OtpTimer from 'otp-timer'
import React, { Component } from "react";

 handleClick=()=>{
   //desired function to be performed on clicking resend button
 }

export default  class Otp extends Component {
  render () {
    return (
      <div>
        <Timer seconds= {30} minutes={0} resend={this.handleClick} />
      </div>
    )
  }
}

User Guide?

Functionality:

Prop nameDescriptionDefault ValueExample
secondsnumber of seconds for which timer must be set30seconds={20}
minutesnumber of minutes for which the timer must be set0minutes={1}
resendfunction that would get triggered on clicking the resend buttonn/aresend={function name}
textcontent that you want to put downTime Left :text="Time Left"
ButtonTextbutton contentResendButtonText="Resend"

Styling:

Prop nameDescriptionDefault ValueExample
textColordescribes the timer's text color"#000000"textColor={"#000000"}
buttonColordescribes the button's text color"#fff"buttonColor={"#fff"}
backgrounddescribe the background color of the button"#0033cc"background={"#0033cc"}