🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-native-otp-input-code

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-otp-input-code

A react native dynamic component that can be used for OTP's and Pins as a secure pin input and can have a dynamic number of inputes.

1.0.8
latest
Source
npm
Version published
Weekly downloads
1
-94.12%
Maintainers
0
Weekly downloads
 
Created
Source
  • A react native dynamic component that can be used for OTP's and Pins as a secure pin input and can have a dynamic number of inputes.

  • It comes with a built-in TypeScript typings and is compatible with all popular JavaScript frameworks. You can use it directly or leverage well-maintained wrapper packages that allow for a more native integration with your frameworks of choice.

Example:

How to use:

import VerificationCodeInput from 'react-native-otp-input-code';

 const [isVarificationCodeValide, setIsVarificationCodeValide] =
    useState(true);
  const [isVarificationCodeSuccess, setIsVarificationCodeSuccess] =
    useState(false);
 const inputRef = useRef(null);

   <VerificationCodeInput
        ref={inputRef}
        isSecure={true}
        textContentType="oneTimeCode"
        keyboardType={KeyboardType.number_pad}
        cellCount={4}
        onComplete={checkVerificationCode}
        onChangeText={(value) => {
          if (value.length < 4) {
            resetBoxes();
          }
        }}
        isValid={isVarificationCodeValide}
         isSuccess={isVarificationCodeSuccess}
        textStyle={{color: "#FFFF"}}
        containerStyle={{borderWidth: 1}}
        errorTextStyle={{color: "red"}}
        errorContainerStyle={{borderColor: "red", borderWidth: 2}}
      />

VerificationCodeInputProps Props extends TextInputProps :

NameType
isValid?boolean
isSuccess?boolean
onComplete(val: string) => void
onChangeText(val: string) => void
uppercase?boolean
keyboardTypeKeyboardType
cellCountnumber
textContentTypetextInputContentType
textStyle?TextStyle
containerStyle?ViewStyle
errorTextStyle?TextStyle
errorContainerStyle?ViewStyle
isSecure?boolean
...propsTextInputProps

Keywords

pin

FAQs

Package last updated on 23 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts