Socket
Socket
Sign inDemoInstall

react-input-verification-code

Package Overview
Dependencies
0
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-input-verification-code


Version published
Maintainers
1
Created

Readme

Source

react-input-verification-code

A verification code input, autocompletion friendly

NPM JavaScript Style Guide

Features

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

Examples

Install

npm install --save react-input-verification-code
yarn add react-input-verification-code

Usage

import * as React from 'react';
import ReactInputVerificationCode from 'react-input-verification-code';

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

API

Props

KeyTypeDefaultRequiredDescription
autoFocusbooleanfalsefalseFocus on render
lengthnumber4falseHow many items will be rendered
onChangefunction() => {}falseFunction called when the value changes
onCompletedfunction() => {}falseFunction called when the code is completed
placeholderstring·falseString rendered in each item when no value has been typed
valuestring() => {}falseControl internal input value
typetext or passwordtextfalseDisplay the item value or a password mask
passwordMaskstringfalsePassword mask

CSS Properties

The following CSS properties are set globally so you can easily override them to fit your needs

KeyDefaultDescription
--ReactInputVerificationCode-itemWidth4.5remWidth of an item
--ReactInputVerificationCode-itemHeight5remHeight of an item
--ReactInputVerificationCode-itemSpacing1remSpace between two items

License

MIT © ugogo

Keywords

FAQs

Last updated on 12 Jul 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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc