Demos
On state
<Field.TogglevalueOn="checked"valueOff="unchecked"variant="checkbox"label="Label text"value="checked"onChange={(value) => console.log('onChange', value)}/>
Off state
<Field.TogglevalueOn="checked"valueOff="unchecked"variant="checkbox"label="Label text"value="unchecked"onChange={(value) => console.log('onChange', value)}/>
No value
<Field.TogglevalueOn="checked"valueOff="unchecked"variant="checkbox"label="Label text"onChange={(value) => console.log('onChange', value)}/>
Disabled
<Field.TogglevalueOn="checked"valueOff="unchecked"variant="checkbox"label="Label text"onChange={(value) => console.log('onChange', value)}disabled/>
Info
Useful information (?)
<Field.TogglevalueOn="checked"valueOff="unchecked"variant="checkbox"label="Label text"onChange={(value) => console.log('onChange', value)}info="Useful information (?)"/>
Warning
I'm warning you...
<Field.TogglevalueOn="checked"valueOff="unchecked"variant="checkbox"label="Label text"onChange={(value) => console.log('onChange', value)}warning={new FormError("I'm warning you...")}/>
Error
This is what is wrong...
<Field.TogglevalueOn="checked"valueOff="unchecked"variant="checkbox"label="Label text"onChange={(value) => console.log('onChange', value)}error={new FormError('This is what is wrong...')}/>
Value types
Boolean value - On state
<Field.TogglevalueOn={true}valueOff={false}variant="checkbox"label="Boolean value"value={true}onChange={(value) => console.log('onChange', value)}/>
Boolean value - Off state
<Field.TogglevalueOn={true}valueOff={false}variant="checkbox"label="Boolean value"value={false}onChange={(value) => console.log('onChange', value)}/>
Number value - On state
<Field.TogglevalueOn={100}valueOff={0}variant="checkbox"label="Number value"value={100}onChange={(value) => console.log('onChange', value)}/>
Number value - Off state
<Field.TogglevalueOn={100}valueOff={0}variant="checkbox"label="Number value"value={0}onChange={(value) => console.log('onChange', value)}/>
Variants
Button
<Field.TogglevalueOn="on"valueOff="off"variant="button"label="Toggle button variant"value="on"onChange={(value) => console.log('onChange', value)}/>
Buttons
<Field.TogglevalueOn="on"valueOff="off"variant="buttons"label="Buttons variant"value="on"onChange={(value) => console.log('onChange', value)}/>
Checkbox button
<Field.TogglevalueOn="on"valueOff="off"variant="checkbox-button"label="Toggle checkbox variant"value="on"onChange={(value) => console.log('onChange', value)}/>