npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rn-otp-inputs

v1.0.17

Published

rn-otp-inputs

Downloads

48

Readme

rn-otp-inputs

rn-otp-inputs is a tiny Javascript library which provides an elegant UI for the end user to input one time passcode (OTP). It handles autocomplete functionality and it display remaining time for OTP. It also features a carefully crafted flow to handle edge cases for volatile user gestures. We provide default UI, but you can always customize the appearance as you like.

ScreenShot

Ios

Android

Installation

npm install --save rn-otp-inputs

or

yarn add rn-otp-inputs

PeerDependencies

NOTES:

This packgae will support react@^17.0.0, react@^18.0.0,react-native@^0.68.0,react-native@^0.69.0,react-native@^0.70.0, react-native@^0.71.0, prop-types@^15.8.1, . Make sure you have install respective viersion.

npm install --save [email protected] [email protected] [email protected]

or

yarn add [email protected] [email protected] [email protected]

Basic Usage

import RnOtpInputs from 'rn-otp-inputs';

...

<RnOtpInputs  pinCount={4} onSubmit={()=>{}} />

More Advanced Usage

import  RnOtpInputs  from  'rn-otp-inputs';

...
const  [value,  setValue]  =  useState('');
...
<RnOtpInputs
  pinCount={4}
  mode='rectangle'
  onSubmit={()=>{}}
  maskText={false}
  autoSubmit={true}
  borderRadius={6}
  borderWidth={1}
  borderColor='#A768F1'
  bgColor='#D9E3F6'
  textColor='#000000'
  onChageValue={setValue}
  keyboardType='number-pad'
  buttonTitle='Verify & Proceed'
  Minute={1}
  Second={0}
  onlyResendOtp={false}
  onResendClick={false}
/>

Parameters

| Parameter | Required | Type | Default | Description | | ------------------- | -------- | ---------- | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | pinCount | Yes | Number | 4 | Number of digits in the component , range is 4-6. | | onSubmit | Yes | Function | ()=>{} | Callback when Submit Button is Click. | | mode | No | String | rectangle | mode can be rectangle, flat or circle. | | maskText | No | Boolean | false | Hide contents of text fields . | | autoSubmit | No | Boolean | false | Callback when the digits are filled . Note : If value is true then we can get entered value from onSubmit. e.g. onSubmit={(value)=>{console.log(value)}} | | borderRadius | No | Number | 6 | Change Border Radius of input field. Note : borderRadius will apply when mode is reactangle | | borderColor | No | String | #A768F1 | Change Border Color of input field. | | borderWidth | No | Number | 1 | Change Border Width of input field. | | bgColor | No | String | #D9E3F6 | Change Background Color of input field. | | textColor | No | String | #000000 | Change the style of the input Text. | | onChageValue | No | Function | ()=>{} | Callback when the digits are Changed. | | keyboardType | No | String | number-pad | Keyboard type. | | buttonTitle | No | String | Verify & Proceed | Button Title . | | Minute | No | Number | 1 | Remaining Time in minute. | | Second | No | Number | 0 | Remaining Time in Second. | | onlyResendOtp | No | Boolean | false | If value is true Remaining time will not Display, Only Resend Otp Button will display. | | onResendClick | No | Function | ()=>{} | Callback when the Resend Button clicked. | | buttonStyle | No | object | {{flex: 1,height: scale(40)}} | Change the style of the Button. | | buttonTitleStyle | No | object | {{fontSize: scale(15),color: "#FFFFFF"}} | Change the style of the Button Title. | | resendButtonStyle | No | object | {{fontSize: scale(15), color: "#404B69"}} | Change the style of the Resend Button. | | inputHeightAndWidth | No | Number | 50 | Height and width of input field. | | isError | No | Boolean | false | To Display Error Message. | | errorMsg | No | String | Invalid OTP. | Change the Error Message. | | errorMsgStyle | No | object | {{fontSize: scale(12),color: "red"}} | Change the style of Error Message. | | isButtonDisplay | No | Boolean | true | If you don't want to use Button, then you have to pass false . NOTE If the value is true and you don't want to use any button for submit , then you have to use autoSubmit props. | | isResendOtpDisplay | No | Boolean | true | If you don't want to use Resend OTP Button, then you have to pass false. |

Contributors

jayanta7381

Jayanta Garu