otp-box-react

1.0.4 • Public • Published

OTP Box React

1.Installation

npm install --save otp-box-react
import { useState } from 'react';
import { OtpInput } from 'otp-box-react';

2.Usage

const [state, setState] = useState({ otp: new Array(6).fill('') });
const onChangeOtpHandler = (otpvalues, event, index) => {
  setState({ ...state, otp: otpvalues });
};
<OtpInput name="otp" className="otp-field" placeholder=" " otpvalue={state.otp} onChangeOtpHandler={onChangeOtpHandler} />

Hi there, I'm Anmol 👋

CodeSandbox    Discord    Linkedin    facebook    twitter    Instagram    slack    stackoverflow

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.4
    10
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.4
    10
  • 1.0.3
    0
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i otp-box-react

Weekly Downloads

10

Version

1.0.4

License

ISC

Unpacked Size

6.84 kB

Total Files

5

Last publish

Collaborators

  • anmolsukki