Skip to content

Toggle Group

A set of toggles fused into a Mac segmented control (clear-gel segments, 1px dividers, blue gel when on), a square bevel strip, or an iPhone bar segmented control. spacing > 0 splits it into separate toggles.

Installation

Requires the theme. Register the @skeuomorph namespace and add @skeuomorph/skeuomorph first, as shown in the installation guide. The CLI also pulls it in as a dependency.

pnpm dlx shadcn@latest add @skeuomorph/toggle-group

Without the namespace, install straight from the URL:

pnpm dlx shadcn@latest add https://ui-skeuomorph.vercel.app/r/toggle-group.json

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

Single

Small

Large

Disabled

Spacing

iOS

variant="ios" renders the segmented control of an iPhone navigation bar or toolbar.

<ToggleGroup type="single" variant="ios" defaultValue="all">
  <ToggleGroupItem value="all">All</ToggleGroupItem>
  <ToggleGroupItem value="missed">Missed</ToggleGroupItem>
</ToggleGroup>