1.0.2 • Published 2 years ago
react-input-verification-code v1.0.2
react-input-verification-code
A verification code input, autocompletion friendly
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
2.0.0-11
2 years ago
2.0.0-10
2 years ago
2.0.0-6
2 years ago
2.0.0-5
2 years ago
2.0.0-4
2 years ago
2.0.0-3
2 years ago
2.0.0-2
2 years ago
2.0.0-1
2 years ago
2.0.0-0
2 years ago
2.0.0-9
2 years ago
2.0.0-8
2 years ago
2.0.0-7
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
1.0.0-1
2 years ago
1.0.0-0
2 years ago
0.9.0
2 years ago
0.7.7
2 years ago
0.8.0
2 years ago
0.7.5
2 years ago
0.7.2
3 years ago
0.7.1
3 years ago
0.7.0
3 years ago
0.6.3
4 years ago
0.6.2
4 years ago
0.6.4
4 years ago
0.6.1
4 years ago
0.5.0
4 years ago
0.4.4
4 years ago
0.4.3
4 years ago
0.4.2
4 years ago
0.4.1
4 years ago
0.3.0
4 years ago
0.4.0
4 years ago
0.2.0
4 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.2
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago