1.0.3 • Published 2 years ago

react18-otp-input v1.0.3

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

react18-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 react18-otp-input

Basic usage:

import React, { useState } from 'react';

import OtpInput from 'react18-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!