Overview
Single toggle
Toggle group
Use
ToggleGroup when toggles are related and should behave as a group — either "single" (radio-like) or "multiple" (checkbox-like). Use standalone Toggle for independent on/off states.Installation
Usage
Variants
Single Toggle (Icon Only)
Off → On
With Label
Off → On
Toggle Group — Single Select
One item can be active at a time (radio-like behavior).Toggle Group — Multi Select (Text Formatting)
Multiple items can be active simultaneously (checkbox-like behavior).Bold + Underline active
Outline Variant
Sizes
API Reference
Toggle
Controlled pressed state.
Callback fired when pressed state changes.
Uncontrolled default pressed state.
Disables the toggle.
Visual style. Values:
default · outlineButton size. Values:
sm · md · lgAccessible label — required for icon-only toggles where the visible content doesn’t describe the action.
ToggleGroup
Selection mode.
"single" allows one active item; "multiple" allows many.Controlled value. String for
single, array for multiple.Callback fired when selection changes.
Uncontrolled default value.
Applies to all items in the group. Values:
sm · md · lgAccessibility
- Toggle renders as a
<button>witharia-pressed="true|false"reflecting the current state - Icon-only toggles must have
aria-labeldescribing the action (e.g."Toggle bold", not"B") ToggleGroupusesrole="group"witharia-labeldescribing the group- Keyboard: Space/Enter toggles the focused item; Arrow keys navigate within
ToggleGroup - State changes are announced to screen readers via
aria-pressed
Do’s & Don’ts
Do
- Use
ToggleGroup type="single"for mutually exclusive view modes (grid/list) - Use
ToggleGroup type="multiple"for independently combinable states (bold + italic) - Always provide
aria-labelfor icon-only toggles - Use Toggle for UI state (view mode, filter) and Switch for settings (on/off preferences)
Don't
- Don’t use Toggle as a navigation element — use Tabs instead
- Don’t use Toggle for binary settings that persist across sessions — use Switch
- Don’t use Toggle for form submission — use a Button or Checkbox
- Don’t put too many items in a ToggleGroup — limit to 4–5 maximum