Home Reference Source
import Input from 'prg-form/src/Input.jsx'
public class | source

Input

Extends:

ComponentBaseInput → Input

Basic input component. In addition to {BaseInput} has theese props:

PropTypes

property type type signature description
name string required input name (you can use dots and array indexes)
placeholder string input placeholder
label string input label
type string "text" input type
className string input class
controlClass string surrounding paragraph class
defaultValue any is used, when input value is falsey
value any use, when input is operated outside <Form>
onChange function (value, input) => {} fired, when input is changed
onFocus function (input) => {} fired, when input is focused
onBlur function (input) => {} fired, when input is blured
disabled boolean disable input
readOnly boolean only read
required boolean input is required - HTML attribute
maxLength number maximal length
iconBefore any content shown before input

Example:

<Input
    name="inputName"
    type="email"
    iconBefore={<i className="fa fa-meetup" />}
/>

Inherited Summary

From class BaseInput
public

getValue(): any

Returns input value

public

resetValue(value: *)

Reset and clean the validation errors

public

setError(error: string)

Show error

public

setValue(value: any): any

Set new value to input