For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
Shadcn Labs/

Segmented Control

An iOS-style segmented control whose thumb glides to the chosen option. A React component built on View Transitions, installed with the shadcn CLI.

Calendar

October 5 – 11

Weekly planning sync with design and engineering. Bring open questions about the launch checklist.

Not saved yet

Installation

$ pnpm dlx shadcn@latest add @transition-kit/segmented-control

Usage

import {
  SegmentedControl,
  SegmentedControlItem,
} from "@/components/transitions/segmented-control";
<SegmentedControl defaultValue="week" name="view" aria-label="Calendar view">
  <SegmentedControlItem value="day">Day</SegmentedControlItem>
  <SegmentedControlItem value="week">Week</SegmentedControlItem>
  <SegmentedControlItem value="month">Month</SegmentedControlItem>
</SegmentedControl>
<SegmentedControl defaultValue="left" size="sm" aria-label="Text alignment">
  <SegmentedControlItem
    value="left"
    icon={<AlignLeft />}
    aria-label="Align left"
  />
  <SegmentedControlItem
    value="center"
    icon={<AlignCenter />}
    aria-label="Align center"
  />
  <SegmentedControlItem
    value="right"
    icon={<AlignRight />}
    aria-label="Align right"
  />
</SegmentedControl>

API Reference

SegmentedControl

PropTypeDefaultDescription
valuestring-Controlled selected value.
defaultValuestring""Initial selected value when uncontrolled.
onValueChange(value: string) => void-Called with the next value when it is selected.
namestring-Submits the selected value with this field name in a surrounding form.
formstring-Associates the hidden input with a form elsewhere in the document.
size"sm" | "md" | "lg""md"Control size.
disabledbooleanfalseDisables the whole control.

SegmentedControlItem

PropTypeDefaultDescription
valuestring-Option value selected by this item.
iconReact.ReactNode-Content rendered before the label.
disabledbooleanfalseDisables this item.