0.0.9 • Published 1 year ago

otp-react-code-input v0.0.9

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

OTP Inputs with SMS

npm version

This npm package provides a disruptive solution for creating OTP code inputs with SMS functionality.

Installation

Install the package using npm and yarn:

npm install otp-react-code-input

or

yarn add otp-react-code-input

Usage

     import { CodeInput } from 'react-otp-input';

Then, you can use the CodeInput component in your JSX code:

     <CodeInput
          isError={isError}
          length={5}
          inputMode='text'
          onChange={handleValue}
          width={64}
          height={64}
        />

Props

PropTypeRequiredDefaultDescription
lengthContent CellYes-The length of the OTP. Users will be allowed to input exactly this number of characters.
heightnumberYes-The height of the input field in pixels.
widthnumberYes-The width of the input field in pixels.
isErrorbooleanNofalseIndicates whether an error state should be displayed for the input field.
onChange(newValue: string) => voidYes-A callback function that will be invoked whenever the OTP value changes.
focusbooleanNofalseDetermines whether the input field should receive focus when the component is rendered.
inputModeInputModeNo'text'Specifies the type of input mode for the field. Available options are: text/numeric.
typetext/numberNo'text'-

Contributing

Contributions are welcome! Fork the repository, make your changes, and submit a pull request.

License

This package is licensed under the MIT License.

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago