0.3.1 • Published 4 years ago

@prakharsharma/react-otp-input v0.3.1

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

react-otp-input

A fully customizable, one-time password input component for the web built with React.

GIPHY

Live Demo

Installation

To install the latest stable version:

npm install --save react-otp-input

Basic usage:

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

export default class App extends Component {
  render() {
    return (
      <div>
        <OtpInput
          onChange={otp => console.log(otp)}
          numInputs={6}
          separator={<span>-<span>}
        />
      </div>
    )
  }
}

API

Development

To run the development server:

npm run dev

To run the development server for example:

npm run docs

To make a production build of the example:

npm run docs:prod

Checklist

  • Add flowtypes
  • Add ESLint, Prettier for code quality
  • Add styling support for states including focus/disabled
  • Travis CI, Codecov
  • Write tests

Contributing

Feel free to open issues and pull requests!

License

MIT