Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
21
increased by50%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc