@fvillard/reactinput
v0.1.30
Published
Show time
Downloads
41
Readme
ReactInput
Input package with validation
Phone and Address type are custum for Switzerland use
Usage
Import
import Input from '@fvillard/reactinput'
Declaration
<Input
/>
Default props
|Props |Description |Default value |
|----------------|-------------------------------------------------------|-----------------------------|
|*id |string
Text showed above input |"" |
|label |string
Text showed above input |"" |
|placeHolder |string
Text showed into input |"" |
|type |string
'text','email','phone','password','file' |"text" |
|value |string
value of input |"" |
|*onChange |function
see #onChange section |"function(){}" |
|onKeyDown |function
see #onKeyDown section |"function(){}" |
|required |boolean
Throw error if empty |false |
|disabled |boolean
disible input |false |
onChange
return function(id, value, error);
Type "text" additionals props
|Props |Description |Default value |
|----------------|-------------------------------|-----------------------------|
|min |integer
min value lenght |null |
|max |integer
max value lenght |null |
Type "text" additionals props
|Props |Description |Default value |
|----------------|-------------------------------|-----------------------------|
|min |integer
min value lenght |null |
|max |integer
max value lenght |null |
|precision |integer
number of float value|0 |
Type "password" additionals props
|Props |Description |Default value |
|----------------|---------------------------------------|-----------------------------|
|level |integer
difficulty of password (1-3) |0 (no control) |
level definition
level 1
Password lenght must be >= 5
level 2
Password lenght must be >= 6 Password need use letter and number
level 3
Password lenght must be >= 8 Password need use letter and number and special char
Type "file" additionals props
onChange
return function(id, content, error);