🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

react-input-verification-code

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-input-verification-code

A React Verification Code Input, Autocompletion Friendly

Source
npmnpm
Version
2.0.0-4
Version published
Weekly downloads
6K
-14.81%
Maintainers
1
Weekly downloads
 
Created
Source

react-input-verification-code

A verification code input, mobile autocompletion friendly

NPM JavaScript Style Guide

Features

  • Support native autocompletion when receiving a code via SMS
  • Support pasted string

Examples

peerDependencies

{
  "react": ">=16.0.0",
  "react-dom": ">=16.0.0"
}

Install

yarn add react-input-verification-code

Usage

import React from 'react';
import ReactInputVerificationCode, {
  ReactInputVerificationCodeProps,
} from 'react-input-verification-code';

const customProps: ReactInputVerificationCodeProps = {
  autoFocus: true,
};

export default function App() {
  return <ReactInputVerificationCode {...customProps} />;
}

API

Props

KeyTypeDefaultRequiredDescription
autoFocusbooleanfalsefalseShould focus on first render
inputPropsReact.InputHTMLAttributes<HTMLInputElement>;undefinedfalseAllow passing custom props into the inputs
lengthnumber4falseHow many inputs will be rendered
onChangefunction() => nullfalseFunction called when the value changes
onCompletedfunction() => nullfalseFunction called when the value is completed
placeholderstring·falseInputs placeholder
valuestring""falseDefault value
type'alphanumeric, number'numberfalseShould accepts alphanumeric values or only numbers

Custom Styles

Simply override the styles using the following classnames

.ReactInputVerificationCode-container {
  /*  */
}

.ReactInputVerificationCode-item {
  /*  */
}

License

MIT © ugogo

Keywords

react

FAQs

Package last updated on 02 Oct 2022

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