1.0.0-beta.3 • Published 1 year ago

@mvp-rockets/react-otp-input v1.0.0-beta.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@mvp-rockets/react-otp-input

GitHub package.json version npm npm All Contributors

A fully customizable, one-time password input component for the web built with React. This package is based on great work of contributers of react-otp-input. But i needed this package and for unknown reasons the contributers of the original package does not accept the open PRs that solve the REACT 18 dependency problem. So based on The PR here i created this package for the others who need this. To see the original package Click

CodeSandbox & LiveDemo

Installation

NPM

To install the latest stable version:

npm install --save @mvp-rockets/react-otp-input

Basic usage:

import React, { useState } from 'react';

import OtpInput from '@mvp-rockets/react-otp-input';

function App() {
  const [otp, setOtp] = useState('');

  return (
    <OtpInput
      inputStyle="inputStyle"
      numInputs={4}
      onChange={(value) => setOtp(value)}
      separator={<span>-</span>}
      isInputNum={true}
      shouldAutoFocus
      value={otp}
    />
  );
}

export default App;

API

Development

To run the development server:

npm run dev

License

NPM

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!