Install package:
npm install mdl-form mdl-form-input react jquery
You need to see mdl-form.
-
default
-> value of input -
type
-> type of input(default: text) -
className
-> add class -
style
-> change style -
max
-> max-length of input -
regular_expression
-> pattern of input -
label
-> name of input -
error
-> text of error will show when it is empty or it is not correspond toregular_expression
. -
isNotRequire
-> if you useisNotRequire: true
, it can be empty. -
change
(function) -> you can do something when input is changed.1st
argument is this component value.
{
'id': 'component_id',
'label': 'Label',
'className': 'class',
'style': {'color': 'red'},
'error': 'Error',
'regular_expression': '[A-Z]+',
'max': '5',
'isNotRequire': true,
'default': 'default',
'type': 'text'
}