Getting Started
Foundations
Components
Search for a command to run...
Toggle groups allow users to control multiple related toggle buttons that share a common context, such as text formatting options in an editor or view mode selections. The group can operate in two modes: single (only one item can be pressed at a time, like radio buttons) or multiple (any number of items can be pressed simultaneously). Toggle groups provide consistent styling and behavior across all items while managing their collective state.
Built on top of Radix UI's ToggleGroup primitive with full keyboard navigation (Tab to move between items, Arrow keys for single mode navigation, Space/Enter to toggle), focus management, and accessibility support including proper ARIA attributes and roving tabindex.
import { ToggleGroup } from "@strongtie/design-system/toggle-group"This module exports the following components:
ToggleGroupToggleGroupItem<ToggleGroup>This component accepts the following custom props. For additional props inherited from Radix UI primitives see the Radix UI documentation.
| Prop | Type | Default | Description |
|---|---|---|---|
size | "default" | "sm" | "lg" | null | 'default' | The size of the toggle button. |
variant | "default" | "outline" | null | 'default' | The visual style variant of the toggle. |
<ToggleGroupItem>This component accepts the following custom props. For additional props inherited from Radix UI primitives see the Radix UI documentation.
| Prop | Type | Default | Description |
|---|---|---|---|
size | "default" | "sm" | "lg" | null | 'default' | The size of the toggle button. |
variant | "default" | "outline" | null | 'default' | The visual style variant of the toggle. |
Components can be styled using the className prop. The design system uses Tailwind CSS for styling.
Other CSS classes used by this component:
toggle-groupThis component inherits accessibility features from Radix UI, including: