Toggle Group

Bundled toggles with shared borders for mutually exclusive choices. Perfect for segmented filters or formatting toolbars.

Toggle group component

Segment control
Uses the same squared toggles with shared borders for clarity.

Installation

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

Usage

import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"
<ToggleGroup type="single" defaultValue="preview">
  <ToggleGroupItem value="preview">Preview</ToggleGroupItem>
  <ToggleGroupItem value="diff">Diff</ToggleGroupItem>
</ToggleGroup>