Toggle / Switch
<Toggle label='Demo' checked={data} onChange={(value) => setData(value)}/>If you need the toggle switch standalone, you can use the Switch component.
Other props are the same, with the exception of label and related props.
<Switch checked={data} onChange={(value) => setData(value)}/>Highlighted props
Section titled “Highlighted props”For the complete list of props, use your IDE’s autocomplete functionality.
Icon, subtitle
Section titled “Icon, subtitle”Augment the label
<Toggle icon={emptyRect} subtitle='Subtitle' label='Demo' checked={data} onChange={setData}/>Disabled
Section titled “Disabled”Prevent interactions with the toggle.
<Toggle label='Demo' checked={data} onChange={(value) => setData(value)} disabled/>Indeterminate state
Section titled “Indeterminate state”Whether the toggle should be rendered in an indeterminate state.
<Toggle label='Demo' checked={data} onChange={(value) => setData(value)} isIndeterminate={data === null}/>