Demos
Unchecked ToggleButton
Code Editor
<ToggleButton label="Label" text="Toggle Me" />
Checked ToggleButton
Code Editor
<ToggleButton label="Label" text="Checked ToggleButton" checked on_change={({ checked }) => { console.log('on_change', checked) }} />
Default ToggleButton group
Code Editor
<ToggleButton.Group label="ToggleButton Group" value="first" on_change={({ value }) => { console.log('on_change', value) }} > <ToggleButton text="First" value="first" /> <ToggleButton text="Second" value="second" /> <ToggleButton text="Third" value="third" /> </ToggleButton.Group>
Multi-select ToggleButton group
Code Editor
<ToggleButton.Group label="Multi-select" multiselect={true} values={['first', 'third']} on_change={({ values }) => { console.log('on_change', values) }} > <ToggleButton text="First" value="first" /> <ToggleButton text="Second" value="second" /> <ToggleButton text="Third" value="third" /> </ToggleButton.Group>
checkbox
variant and multiselect
Vertical aligned ToggleButton group with Code Editor
<ToggleButton.Group label="Vertical Group" layout_direction="column" multiselect={true} variant="checkbox" on_change={({ values }) => { console.log('on_change', values) }} > <ToggleButton text="First" value="first" /> <ToggleButton text="Second" value="second" /> <ToggleButton text="Third" value="third" checked /> </ToggleButton.Group>
multiselect
with a status message
ToggleButton group as Code Editor
<ToggleButton.Group label="ToggleButton Group with status" status="Error message" multiselect={true} on_change={({ values }) => { console.log('on_change', values) }} > <ToggleButton text="First" value="first" /> <ToggleButton text="Second" value="second" checked /> <ToggleButton text="Third" value="third" checked={true} /> </ToggleButton.Group>