react-toolbox/components/input
@soyjavi 2423d09a4f Rename component doc to readme.md 2015-10-28 22:09:09 +07:00
..
_config.scss Remove unneeded css variables 2015-10-20 21:38:33 +02:00
index.jsx update webpack dev, test and build & update eslint rule 2015-10-23 16:11:40 +08:00
readme.md Rename component doc to readme.md 2015-10-28 22:09:09 +07:00
style.scss Csscomb for inputs 2015-10-21 01:53:01 +02:00

readme.md

Input

var Input = require('react-toolbox/components/input');

<Input value='Hello' required />
<Input multiline value='Lorem ipsum...' disabled />
<Input type='number' value='1980' label='Year of birthdate' />

Properties

Name Type Default Description
className String Sets the class-styles of the Component.
disabled Boolean false If true, component will be disabled.
error String Sets the error string.
label String The text string to use for the floating label element.
multiline Boolean false If true, a textarea element will be rendered. The textarea also grows and shrinks according to the number of lines.
icon String Icon String key.
onBlur Function Callback function that is fired when components is blured.
onChange Function Callback function that is fired when the components's value changes.
onFocus Function Callback function that is fired when components is focused.
onKeyPress Function Callback function that is fired when a key is pressed.
required Boolean false If true, component needs has a value.
type String "normal" Type of the component, overwrite this property if you need set a different stylesheet.
value String Default value using JSON data.

Methods

focus

The focus event is sent to an element when it gains focus.

input_instance.focus();

blur

The blur event is sent to an element when it loses focus

input_instance.blur();

getValue

Returns the value of the input.

input_instance.getValue();

setValue

Sets the value of the input element.

input_instance.setValue(newValue);

setError

input_instance.setError("Something is wrong...");