110k
New

Toggle Group

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

Component toggle-group-demo not found in registry.

Installation

pnpm dlx createui@latest add toggle-group

Usage

import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"
<ToggleGroup type="single">
  <ToggleGroupItem value="a">A</ToggleGroupItem>
  <ToggleGroupItem value="b">B</ToggleGroupItem>
  <ToggleGroupItem value="c">C</ToggleGroupItem>
</ToggleGroup>

Examples

Outline

Use variant="outline" for an outline style.

Component toggle-group-outline not found in registry.

Size

Use the size prop to change the size of the toggle group.

Component toggle-group-sizes not found in registry.

Spacing

Use spacing to add spacing between toggle group items.

Component toggle-group-spacing not found in registry.

Vertical

Use orientation="vertical" for vertical toggle groups.

Component toggle-group-vertical not found in registry.

Disabled

Component toggle-group-disabled not found in registry.

API Reference

See the Radix Toggle Group documentation.