Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

mmusaib/react-native-text-input-otp

Repository files navigation

NPM VERSION NPM WEEKLY DOWNLOADS GITHUB STAR YOUTUBE VIEWS NPM LIFETIME DOWNLOADS

πŸ³οΈβ€πŸŒˆ React Native OTP Text Input

🟒 Splitted OTP Text Input for ReactNative and Expo powered apps

Android Demo iOS Demo

Light Weight and Robust Splitted Text Input.

  • Design split OTP component of your choice
  • Pass number of OTP digits by your choice
  • Fully Customizable by props
  • Very Easy to use
  • Make your apps professional in UI/UX

Compatibility

iOS Android Expo
βœ… βœ… βœ…

πŸ”Œ Installation

$ npm install react-native-text-input-otp

OR

$ yarn add react-native-text-input-otp

😎 Displaying the otp input

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} 
 />
 )
};

For Live Demo (Expo Snack)

⭐ Props for the component

Name Type Reuired Description
otp state variable Yes State variable to store the otp
setOtp state update method Yes Method to update state variable
digits numeric Yes No of otp split fields
style style object No Style of the input fields
fontStyle style object No Style of font in input fields
focusedStyle style object No Style of field when in focus

πŸ’² Would you like to support me?

If you would like me come up with similar packages, buy me a cup of coffee to boost my energy.

Paypal

▢️ Watch Tutorial Video

Watch video

Sponsor this project

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /