Components · Actions · Toggle Group
Back to Toggle GroupToggle GroupNew
Use for a row of icon or text toggle buttons - single-select or multi-select - for tool-like options that act immediately.
Properties
Size, corner radius and the content options below are properties of the same component, not separate elements - change them to check this component's appearances and states in the Live Preview.
Live Preview
Every appearance side by side, each in every state. One full matrix is rendered per selected Size and Corner radius combination.
When to use
A formatting toolbar - bold, italic, underline.
Component Guide
Overview
Toggle Group is a flat bordered strip of toggle buttons. In single mode one item is pressed at a time; in multiple mode each item toggles independently.
When to Use
- A formatting toolbar - bold, italic, underline.
- View options on a canvas, map or editor.
- Icon filters.
When Not to Use
- Switching views or ranges - use Group Button.
- Form settings saved together - use Checkbox or Switch.
- Long text labels or many wrapping options - use chips.
Best Practices
- Use multiple for independent on/off options and single for exclusive ones.
- Give every icon-only item a label.
- Keep items as direct children of the group.
Accessibility
- Single mode is role=radiogroup; multiple is role=group with aria-pressed buttons.
- Roving tabindex - one tab stop; Arrow keys move focus, Home/End jump.
- Pressed state is conveyed by aria-checked or aria-pressed as well as fill.
Related Components
Group Button, Radio, Checkbox, Switch.
{
"component": "Toggle Group",
"category": "Actions",
"summary": "Toggle Group is a flat bordered strip of toggle buttons. In single mode one item is pressed at a time; in multiple mode each item toggles independently.",
"whenToUse": [
"A formatting toolbar - bold, italic, underline.",
"View options on a canvas, map or editor.",
"Icon filters."
],
"whenNotToUse": [
"Switching views or ranges - use Group Button.",
"Form settings saved together - use Checkbox or Switch.",
"Long text labels or many wrapping options - use chips."
],
"bestPractices": [
"Use multiple for independent on/off options and single for exclusive ones.",
"Give every icon-only item a label.",
"Keep items as direct children of the group."
],
"accessibility": [
"Single mode is role=radiogroup; multiple is role=group with aria-pressed buttons.",
"Roving tabindex - one tab stop; Arrow keys move focus, Home/End jump.",
"Pressed state is conveyed by aria-checked or aria-pressed as well as fill."
],
"relatedComponents": [
"Group Button",
"Radio",
"Checkbox",
"Switch"
]
}