Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-otp-timer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-otp-timer

You can use this component in login with otp. ## Install

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-otp-timer

You can use this component in login with otp.

Install

npm install react-otp-timer --save

Usage

Just import the component and pass the no of minutes and styles in otp component.

import React                from 'react'
import Otp        from 'components/Otp'
class App extends React.Component {


    //callback of resend button
    resendEvent() { 
     
     console.log("***************Resend button pressed do stuff here *********************")

    }
    
    render() {
      let style = {
          otpTimer:{
              margin:'10px',
              color:'blue',
          },
          resendBtn:{
            backgroundColor:'#5cb85c',
            color:'white',
            border: '1 px solid #ccc'
          }
      }

    return (
        <div>
            <h1>Otp Timer counter</h1>
            <Otp
                style={style}
                minutes={1.5}      // Minutes ( Pass the no of minutes that you want count )
                resendEvent={this.resendEvent.bind(this)} //  Resend button event you can pass your function name here
            />
        </div>
    )
  }
}
export default App

how to restart a otp-timer

There is resendEvent props which will return callback function

    <Otp
       style={style}
       minutes={1.5}      // Minutes ( Pass the no of minutes that you want count )
       resendEvent={...} //  Pass your callback function here
    />

Demo

You can see the demo here visit http://otptimer.surge.sh

FAQs

Package last updated on 06 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc