1.0.0 • Published 7 months ago

react-native-biotp v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

React Native BiOTP

A simple yet powerful OTP (One-Time Password) input component for React Native applications.

Installation

npm install react-native-biotp
# or
yarn add react-native-biotp

Usage

import BiOTP from 'react-native-biotp';

const App = () => {
  return (
    <BiOTP
      length={6}
      onFilled={(code) => console.log('OTP Code:', code)}
      variant="box"
      focusColor="#007AFF"
    />
  );
};

Props

PropTypeDefaultDescription
lengthnumber6Length of the OTP code
variant'box' | 'underline''box'Visual style of the input
darkbooleanfalseEnable dark mode
onTextChange(text: string) => void-Callback when text changes
onFilled(code: string) => void-Callback when all digits are filled
onSubmit(code: string) => void-Callback when submit button is pressed
focusColorstring'#007AFF'Color of the focused input
typeKeyboardTypeOptions'numeric'Keyboard type for input
placeholderstring'0'Placeholder for empty inputs
visiblebooleanfalseControl visibility of OTP input
titlestring'Enter Verification Code'Title text
buttonStyle'primary' | 'secondary''primary'Style variant for button

License

MIT