React Native component for OTP Input Form
yarn add react-native-otp-form
npm install react-native-otp-form --save
import OTP from "react-native-otp-form"
<OTP
codeCount={6}
containerStyle={{ marginTop: 50 }}
otpStyles={{ backgroundColor: "#eee" }}
/>
Check out the example project for more examples.
Type | Required | Description |
---|---|---|
codeCount | Yes | How many otp box/character |
containerStyle | No | Styles for container View |
otpStyle | No | Styles for each of TextInput |
onTyping | No | Callback to get otp when user typing |
onFinish | No | Callback to get otp value when user finish filled all boxes |
...TextInputProps | No | TextInput Props |
While developing, you can run the example app to test your changes.
- Clone the repository
- Go to Example folder (Expo)
- Run
yarn install
- Run
yarn start
The library is released under the MIT licence. For more information see LICENSE
.