react-otp-module
v1.3.0
Published
This library is for OTP input with some customizations
Downloads
5
Readme
react-otp-module
A fully customizable, one-time password input component for the web built with React.
Installation
To install the latest stable version:
npm install --save react-otp-module
Basic usage:
import React, { useState } from 'react'
import OtpInput from 'react-otp-module'
const App = () => {
const [otp, setOtp] = useState()
return (
<form>
<label htmlFor='otp'>Enter your OTP here</label>
<OtpInput
id="otp"
value={otp}
onChange={setOtp}
numInputs={6}
separator={<span className='px-2'></span>}
inputStyle='otp__input'
placeholder='------'
isInputNum={true}
/>
</form>
)
}
export default App
Props
License
Contributors ✨
This project follows the all-contributors specification. Contributions of any kind welcome!
License
MIT © jagannath-swarnkar