1.3.0 • Published 10 months ago

react-encrypted-input v1.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

react-encrypted-input

React compoent for encrypting the input characters

Installation

npm install react-encrypted-input --save

or

yarn add react-encrypted-input

Demo

demo

Usage

import EncryptedInput from 'react-encrypted-input'

<EncryptedInput front="1" end="2" />

pic1

pic2

Props

PropertyTypeDefaultDescription
modestring'encrypted'mode for input, value is encrypted or plain.if mode is encrypted ,the input will show encrypted
initValuestring''default value for input
frontnumber0number of digits displayed before the string,eg: if the input value is '123456',front is 2, this input value will show 12****
endnumber0number of digits displayed after the string,eg: if the input value is '123456',end is 2, this input value will show 1234**
showIconstringshowIconDefaultIcon for plaintext input
closeIconstringcloseIconDefaultIcon for plaintext input
styleobject{}the component style,if you want to change input's style ,you can set style = {input:{fontSize:'20px'}};If you want to change icon's style,you can set style = {icon:{width:'100px',border:'1px solid red'}}

Functions

NameDescriptionType
onChange()Callback when input changes,the first param is input value,the second param is encrypted input(value,mValue)=>{}
1.3.0

10 months ago

1.2.0

10 months ago

1.1.0

10 months ago

1.0.0

10 months ago