react-input-verification-code
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Key Type Default Required Description
autoFocus boolean false false Focus on render
length number 4 false How many items will be rendered
onChange function () => {} false Function called when the value changes
onCompleted function () => {} false Function called when the code is completed
placeholder string · false String rendered in each item when no value has been typed
value string () => {} false Control internal input value
type text or password text false Display the item value or a password mask
passwordMask string false Password mask

CSS Properties

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

Key Default Description
--ReactInputVerificationCode-itemWidth 4.5rem Width of an item
--ReactInputVerificationCode-itemHeight 5rem Height of an item
--ReactInputVerificationCode-itemSpacing 1rem Space between two items

License

MIT © ugogo

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.24,379latest
2.0.0-110next

Version History

VersionDownloads (Last 7 Days)Published
2.0.0-110
2.0.0-100
2.0.0-90
2.0.0-80
2.0.0-70
2.0.0-61
2.0.0-50
2.0.0-41
2.0.0-30
2.0.0-20
2.0.0-110
2.0.0-07
1.0.24,379
1.0.1362
1.0.00
1.0.0-10
1.0.0-00
0.9.0300
0.8.0479
0.7.737
0.7.526
0.7.221
0.7.110
0.7.00
0.6.435
0.6.31
0.6.20
0.6.10
0.5.00
0.4.40
0.4.30
0.4.20
0.4.10
0.4.00
0.3.00
0.2.00
0.1.41
0.1.30
0.1.21
0.1.10
0.1.00

Package Sidebar

Install

npm i react-input-verification-code

Weekly Downloads

5,671

Version

1.0.2

License

MIT

Unpacked Size

53.8 kB

Total Files

9

Last publish

Collaborators

  • onaliugo