react-toolbox/components/switch
@soyjavi c1c1a9a931 Pure <Switch> 2015-11-12 11:52:05 +07:00
..
_config.scss Csscomb and better style for switch scss 2015-10-21 01:21:01 +02:00
index.jsx Pure <Switch> 2015-11-12 11:52:05 +07:00
readme.md Pure <Switch> 2015-11-12 11:52:05 +07:00
style.scss Pure <Switch> 2015-11-12 11:52:05 +07:00

readme.md

Switch

On/off switches toggle the state of a single settings option. The option that the switch controls, as well as the state its in, should be made clear from the corresponding inline label. Switches take on the same visual properties of the radio button.

import Switch from 'react-toolbox/lib/switch';

const SwitchTest = () => (
  <fieldset>
    <Switch label="Push notifications" />
    <Switch checked label="Mail notifications" />
    <Switch disabled label="Nothing, thanks"/>
  </fieldset>
);

Properties

Name Type Default Description
checked Boolean false If true, the switch will be enabled.
className String '' Sets a class to give custom styles to the switch.
disabled Boolean false If true, component will be disabled.
label String The text string to use for the floating label element.
name String The text string used as name of the input.
onChange Function Callback function that is fired when the components's value changes.