react-toolbox/components/switch/readme.md

35 lines
994 B
Markdown
Raw Normal View History

2015-07-10 09:44:44 +03:00
# Switch
```
var Switch = require('react-toolbox/components/switch');
<Switch value={true} />
<Switch label='Online users' disabled/>
```
## Properties
| Name | Type | Default | Description|
|:- |:-: | :- |:-|
| **className** | String | | Sets the class-styles of the Component.|
| **disabled** | Boolean | false | If true, component will be disabled.|
| **label** | String | | The text string to use for the floating label element.|
| **onChange** | Function | | Callback function that is fired when the components's value changes.|
| **value** | String | | Default value using JSON data.|
## Methods
#### getValue
Returns the value of the input.
```
switch_instance.getValue();
```
#### setValue
Sets the value of the input element.
```
switch_instance.setValue(newValue);
```