Toggle group

A toggle group is a group of controls that can be used to quickly switch between actions or states.

Examples

Default with multiple selectable

Default with single selectable

Icons

Text and icons


Compact variant

Props

ToggleGroup

*required
NameTypeDefaultDescription
areAllGroupsDisabledbooleanfalseDisable all toggle group items under this component.
aria-labelstringAccessible label for the toggle group
childrenReact.ReactNodeContent rendered inside the toggle group
classNamestringAdditional classes added to the toggle group
isCompactbooleanfalseModifies the toggle group to include compact styling.

ToggleGroupItem

*required
NameTypeDefaultDescription
aria-labelstringrequired when icon is used with no supporting text
buttonIdstringOptional id for the button within the toggle group item
classNamestringAdditional classes added to the toggle group item
iconReact.ReactNodeIcon rendered inside the toggle group item
iconPosition'start' | 'end''start'Sets position of the icon when text is also passed in
isDisabledbooleanfalseFlag indicating if the toggle group item is disabled
isSelectedbooleanfalseFlag indicating if the toggle group item is selected
onChange(event: React.MouseEvent<any> | React.KeyboardEvent | MouseEvent, selected: boolean) => void() => {}A callback for when the toggle group item selection changes.
textReact.ReactNodeText rendered inside the toggle group item

CSS variables

Expand or collapse columnSelectorVariableValue

View source on GitHub