1.0.1 • Published 1 month ago

@shanmukeshwar/react-native-otp-input v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

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

PlatformiOSAndroidExpo

Installation

npm install react-native-text-input-otp

or

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:

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

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

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

Props

NameTypeRequiredDescription
otpstate variableYesState variable to store the OTP
setOtpstate update methodYesMethod to update state variable
digitsnumberYesNumber of OTP split fields
stylestyle objectNoStyle of the input fields
fontStylestyle objectNoStyle of font in input fields
focusedStylestyle objectNoStyle of field when in focus
keyboardAppearancestringNoKeyboard Appearance Style

Contributing

Contributions are welcome! Please follow the contributing guidelines when submitting a pull request.

License

This project is licensed under the MIT License.

1.0.1

1 month ago

1.0.0

2 months ago