Demos
Unchecked Switch
<Switch label="Switch" on_change={onChange} />
Checked Switch
<Switchlabel="Label:"label_position="left"checkedon_change={({ checked }) => console.log(checked)}/>
Checked Switch with error message
Error message
<Switch label="Switch" checked status="Error message" />
Switch with suffix
<Switchlabel="Switch"checkedsuffix={<HelpButton title="Modal Title">Modal content</HelpButton>}/>
Switch in different sizes
As for now, there are two sizes. medium
is the default size.
<Switch size="medium" label="Medium" right="large" checked /><Switch size="large" label="Large" right="large" checked /><Switch size="large" label="Large" />
Switch in disabled state
<Switch checked disabled label="Disabled" />