Demos
Unchecked ToggleButton
<ToggleButton label="Label:" text="Toggle Me" />
Checked ToggleButton
<ToggleButtonlabel="Label:"text="Checked ToggleButton"checkedon_change={({ checked }) => {console.log('on_change', checked)}}/>
Default ToggleButton group
<ToggleButton.Grouplabel="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
<ToggleButton.Grouplabel="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 <ToggleButton.Grouplabel="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 <ToggleButton.Grouplabel="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>
radio
ToggleButton with status messages and a group variant as <ToggleButton.Grouplabel="ToggleButtons with status:"variant="radio"on_change={({ value }) => {console.log('on_change', value)}}><ToggleButton text="First" value="first" status="error" /><ToggleButtontext="Second"value="second"checkedstatus="Error message"/><ToggleButtontext="Third"value="third"status="Info message"status_state="info"/></ToggleButton.Group>
Disabled ToggleButton group
<ToggleButton.Group label="Disabled Group:" disabled variant="checkbox"><ToggleButton text="First" value="first" /><ToggleButton text="Second" value="second" /><ToggleButton text="Third" value="third" checked /></ToggleButton.Group>
ToggleButtons with a suffix
<ToggleButton.Grouplabel="With suffixes:"suffix={<HelpButton title="Group suffix">Group suffix</HelpButton>}><ToggleButton text="First" value="first" /><ToggleButtontext="Second"value="second"status="Error message"suffix={<HelpButton title="Button suffix">Button suffix</HelpButton>}/><ToggleButton text="Third" value="third" checked /></ToggleButton.Group>
ToggleButtons with icons only
<ToggleButton.Group label="Icons only:"><ToggleButton icon="bell" value="first" checked /><ToggleButton icon="loupe" value="second" /><ToggleButton icon="calendar" value="third" /></ToggleButton.Group>