react-otp-code
TypeScript icon, indicating that this package has built-in type declarations

1.1.10 • Public • Published

react-otp-code

One time password component

CodeSandbox

Installation

NPM

To install the latest stable version:

npm install react-otp-code

Basic usage:

import { OtpCode } from 'react-otp-code';
import { useEffect, useState } from 'react';

export default function App() {
    const [test, setTest] = useState('');

    return (
        <div className="App">
            <OtpCode onChange={setTest} classNames={'yourClassName'} />
        </div>
    );
}

API

Name
Type Required Default Description
classNames classname false null Overrides the default styling
items number false 6 Number of inputs
onChange function true empty string Returns a string

Package Sidebar

Install

npm i react-otp-code

Weekly Downloads

0

Version

1.1.10

License

MIT

Unpacked Size

27.6 kB

Total Files

21

Last publish

Collaborators

  • cychopp