Simple Switch
Calling the component
<SSwitch />Size
The size of the switch can be changed by passing the
sizeprop to the component. The default size ismedium.
<SSwitch size="small" /><SSwitch size="medium" /><SSwitch size="large" />Color
The color of the switch can be changed by passing the
colorprop to the component. The default color isblue.
<SSwitch color="blue" /><SSwitch color="green" />Checked
The checked state of the switch can be changed by passing the
checkedprop to the component. The default checked state isfalse.
<SSwitch checked /><SSwitch />Disabled
The disabled state of the switch can be changed by passing the
disabledprop to the component. The default disabled state isfalse.
<SSwitch disabled /><SSwitch />On Change
The
onChangeprop can be used to handle the change event of the switch.
<SSwitch onChange={(e) => console.log(e.target.checked)} />