# otp-react-code-input

> [![npm version](https://badge.fury.io/js/otp-react-code-input.svg)](https://badge.fury.io/js/otp-react-code-input)

Latest version **0.0.9** (published 2023-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install otp-react-code-input
pnpm add otp-react-code-input
yarn add otp-react-code-input
bun add otp-react-code-input
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2023-04-27 |
| First published | 2023-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 35.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Gil Akiva |
| Maintainers | gilakiva |
| Keywords | react, typescript |

## Links

- npm: https://www.npmjs.com/package/otp-react-code-input
- Repository: https://github.com/GilAkivaWebiya/CodeInput
- Homepage: https://github.com/GilAkivaWebiya/CodeInput#readme
- Issues: https://github.com/GilAkivaWebiya/CodeInput/issues
- npm.io page: https://npm.io/package/otp-react-code-input

## Dependencies (3)

- [@mui/material](https://npm.io/package/@mui/material.md) ^5.12.2
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.10.6
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^11.10.6

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.9 (latest) — 2023-04-27
- 0.0.8 — 2023-04-27
- 0.0.7 — 2023-04-27
- 0.0.6 — 2023-04-27
- 0.0.5 — 2023-04-27
- 0.0.4 — 2023-04-27
- 0.0.3 — 2023-04-27
- 0.0.2 — 2023-04-27
- 0.0.1 — 2023-04-27
- 1.0.1 — 2023-04-27
- 1.0.0 — 2023-04-27

## README

# OTP Inputs with SMS

[![npm version](https://badge.fury.io/js/otp-react-code-input.svg)](https://badge.fury.io/js/otp-react-code-input)

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

## Installation

### Install the package using npm and yarn:

```bash
npm install otp-react-code-input
```

or

```bash
yarn add otp-react-code-input
```
## Usage
 
```javascript
     import { CodeInput } from 'react-otp-input';
```
Then, you can use the CodeInput component in your JSX code:

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

## Props 

| Prop  | Type | Required | Default | Description |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| length  | Content Cell  | Yes | - | The length of the OTP. Users will be allowed to input exactly this number of characters. |
| height  | number  | Yes | - | The height of the input field in pixels. |
| width  | number  | Yes | - | The width of the input field in pixels. |
| isError  | boolean  | No | false | Indicates whether an error state should be displayed for the input field. |
| onChange  | (newValue: string) => void  | Yes | - | A callback function that will be invoked whenever the OTP value changes. |
| focus  | boolean  | No | false | Determines whether the input field should receive focus when the component is rendered. | 
| inputMode  | InputMode | No | 'text' | Specifies the type of input mode for the field. Available options are: text/numeric. |
| type | text/number | No | '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.

---
_Source: https://npm.io/package/otp-react-code-input · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
