react-otp-input-2

1.0.1 • Public • Published

react-otp-input-2

Updated version of react-otp-input with bug fixes.

NPM JavaScript Style Guide

Install

npm install --save react-otp-input-2

Usage

import React, { Component } from 'react';
import OtpInput from 'react-otp-input';

export default class App extends Component {
  state = { otp: '' };

  handleChange = (otp) => this.setState({ otp });

  render() {
    return (
      <OtpInput
        value={this.state.otp}
        onChange={this.handleChange}
        numInputs={6}
        separator={<span>-</span>}
      />
    );
  }
}

License

MIT © shubhlpu16

Package Sidebar

Install

npm i react-otp-input-2

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

71.5 kB

Total Files

7

Last publish

Collaborators

  • shubhlpu16