# react-native-verify-otp-inputs

> react-native-verify-otp is a tiny Javascript library which provides an elegant UI for the end user to input OTP

Latest version **0.1.7** (published 2025-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-verify-otp-inputs
pnpm add react-native-verify-otp-inputs
yarn add react-native-verify-otp-inputs
bun add react-native-verify-otp-inputs
```

## Health

**Score 60/100 (C)** — status: stable.

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

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2025-10-06 |
| First published | 2023-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 16.0.0 |
| Dependencies | 0 |
| Unpacked size | 80.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Richard Nguyen |
| Maintainers | dev.richard.nguyen |
| Keywords | react-native, ios, android, otp-inputs, inputs, otp, react-native-verify-otp-inputs, react-native-verify-otp, react-native-otp, react-native-otp-inputs |

## Links

- npm: https://www.npmjs.com/package/react-native-verify-otp-inputs
- Repository: https://github.com/dev-richardnguyen/react-native-verify-otp-inputs
- Homepage: https://github.com/dev-richardnguyen/react-native-verify-otp-inputs#readme
- Issues: https://github.com/dev-richardnguyen/react-native-verify-otp-inputs/issues
- npm.io page: https://npm.io/package/react-native-verify-otp-inputs

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.7 (latest) — 2025-10-06
- 0.1.6 — 2024-10-12
- 0.1.5 — 2023-03-13
- 0.1.4 — 2023-03-10
- 0.1.3 — 2023-03-10
- 0.1.1 — 2023-03-09
- 0.1.0 — 2023-03-09

## README

# react-native-verify-otp-inputs

react-native-verify-otp is a tiny Javascript library which provides an elegant UI for the end user to input OTP

## Demo
![](https://raw.githubusercontent.com/dev-richardnguyen/react-native-verify-otp-inputs/main/variant-default.gif)
![](https://raw.githubusercontent.com/dev-richardnguyen/react-native-verify-otp-inputs/main/variant-security.gif)
![](https://raw.githubusercontent.com/dev-richardnguyen/react-native-verify-otp-inputs/main/variant-underlined.gif)


## Installation

```sh
yarn add react-native-verify-otp-inputs
```

## Usage

```js
import { OTPInput } from 'react-native-verify-otp-inputs';

// ...

export default function App() {
  const [otp, setOtp] = React.useState('');
  return (
    <View style={styles.container}>
      <OTPInput
        onSubmit={(otp: string) => {
          setOtp(otp);
        }}
        pinCount={6}
        boxSelectedStyle={styles.boxSelectedStyle}
        boxStyle={styles.boxStyle}
        digitStyle={styles.digitStyle}
        autoSubmit={false}
      />

      <TouchableOpacity
        style={styles.btn}
        disabled={otp.length < 6}
        onPress={() => {
          Alert.alert('Done!', otp);
        }}
      >
        <Text style={{ color: 'white' }}>Submit</Text>
      </TouchableOpacity>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  boxSelectedStyle: {
    backgroundColor: 'red',
  },
  boxStyle: {
    borderRadius: 8,
  },
  digitStyle: {
    color: 'gray',
  },
});

```

## Parameters
Parameter | required | Description |
--- | --- | --- |
onSubmit | YES | Callback when input digits are done | 
pinCount | NO | Number of digits in the component (**default** is 6) |
boxSelectedStyle | NO | The style of the input field which is focused |
boxStyle | NO | The style of the input field which is NOT focused |
digitStyle | NO | The style of the digit |
boxContainerStyle | NO | The style of container |
autoSubmit | NO | Enable auto submit when entering full otp. Default is false |


## License

MIT

---

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