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

0.0.11 • Public • Published

react-native-otp-field

React Native OTP Field

1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣

Installation

npm i react-native-otp-field

RN < 0.63

npm i react-native-otp-field@0.0.7

A tiny library that works on both android and iOS.

Props

Props Type Description
length Number OTP length
value String OTP string
onChange Function called when OTP is changed with new value as argument
textFieldStyle Object style for text field
containerStyle Object style for text field container.
error string error text to display.
errorStyle Object style for error container.

Note: It accepts all other props of RN TextField

Usage:

import OTPField from 'rn-otp-field';

render() {
  return {
    ...
    <OTPField
      length={5}
      value={'123'}
      error={'Please fill in complete OTP.'}
    />
    ...
  };
}

Image of OTPField

Package Sidebar

Install

npm i react-native-otp-field

Weekly Downloads

20

Version

0.0.11

License

MIT

Unpacked Size

6.77 kB

Total Files

5

Last publish

Collaborators

  • rbareja72