Skip to content

Toggle Group

A set of two-state buttons that can be toggled on or off.

Install

Bash
npx @madeui/cli add toggle-group

Usage

TSX
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group';

Composition

TSX
<ToggleGroup>
  <ToggleGroupItem value="…" />
</ToggleGroup>

Joined

spacing="joined" fuses the items into one segmented control.

Outline

Sizes

Vertical

Disabled

API reference

Built on Base UI Toggle Group. The table below covers the props this library adds — every other prop (value, defaultValue, toggleMultiple, disabled, …) is forwarded; see the Base UI Toggle Group API reference.

ToggleGroup

PropTypeDefaultDescription
variant'default' | 'outline''default'Inherited by items.
size'sm' | 'md' | 'lg''md'Inherited by items.
spacing'gap' | 'joined''gap'joined fuses items into a segmented control.
orientation'horizontal' | 'vertical''horizontal'
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.

ToggleGroupItem

Accepts all Toggle props; variant and size default to the group’s values.

Was this page helpful?