# @shanmukeshwar/react-native-otp-input

> React Native OTP Text Input

Latest version **1.0.1** (published 2024-05-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @shanmukeshwar/react-native-otp-input
pnpm add @shanmukeshwar/react-native-otp-input
yarn add @shanmukeshwar/react-native-otp-input
bun add @shanmukeshwar/react-native-otp-input
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2024-05-02 |
| First published | 2024-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 145.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Shanmukeshwar |
| Maintainers | shanmukeshwar |
| Keywords | expo-otp-input, react-native-otp |

## Links

- npm: https://www.npmjs.com/package/@shanmukeshwar/react-native-otp-input
- Repository: https://github.com/thestackdev/react-native-otp
- Homepage: https://github.com/mmusaib/react-native-otp#readme
- Issues: https://github.com/thestackdev/react-native-otp/issues
- npm.io page: https://npm.io/package/@shanmukeshwar/react-native-otp-input

## Recent versions

- 1.0.1 (latest) — 2024-05-02
- 1.0.0 — 2024-04-27

## README

<h1 align="center"> React Native OTP </h1>

<div align="center">
  <img src="assets/screenshot.png" alt="React Native OTP" width="200"/>
</div>

<p align="center">
  <strong>Light Weight and Robust Splitted Text Input for React Native</strong>
</p>

<p align="center">
  <a href="https://github.com/your-username/react-native-text-input-otp#compatibility">Compatibility</a>
  •
  <a href="https://github.com/your-username/react-native-text-input-otp#installation">Installation</a>
  •
  <a href="https://github.com/your-username/react-native-text-input-otp#usage">Usage</a>
  •
  <a href="https://github.com/your-username/react-native-text-input-otp#props">Props</a>
</p>

## Features

- Design split OTP component of your choice
- Pass number of OTP digits by your choice
- Fully customizable with props
- Very easy to use
- Make your apps professional in UI/UX

## Compatibility

| Platform | iOS | Android | Expo |
| -------- | --- | ------- | ---- |
| ✅       | ✅  | ✅      | ✅   |

## Installation

```sh
npm install react-native-text-input-otp
```

or

```sh
yarn add react-native-text-input-otp
```

## Usage

All you need is to just import the OTP text input component and then pass the required props to display the splitted OTP text input as shown in the code snippet below:

```jsx
import OtpTextInput from "react-native-text-input-otp";

const App = () => {
  const [otp, setOtp] = React.useState("");

  return <OtpTextInput otp={otp} setOtp={setOtp} digits={5} />;
};
```

## Props

| Name                 | Type                | Required | Description                     |
| -------------------- | ------------------- | -------- | ------------------------------- |
| `otp`                | state variable      | Yes      | State variable to store the OTP |
| `setOtp`             | state update method | Yes      | Method to update state variable |
| `digits`             | number              | Yes      | Number of OTP split fields      |
| `style`              | style object        | No       | Style of the input fields       |
| `fontStyle`          | style object        | No       | Style of font in input fields   |
| `focusedStyle`       | style object        | No       | Style of field when in focus    |
| `keyboardAppearance` | string              | No       | Keyboard Appearance Style       |

## Contributing

Contributions are welcome! Please follow the [contributing guidelines](CONTRIBUTING.md) when submitting a pull request.

## License

This project is licensed under the [MIT License](LICENSE).

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