Segmented control
One of a few options side by side: the thumb is thrown to the new segment while its width eases to the new label.
Used forView switchesBilling periodChart rangesEditor modes
Install with the shadcn CLI
Templates
Need the whole page?
43 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $99, and 5 are free.
Where it’s used
View switches
Day, week and month on a calendar.
Billing period
Monthly or yearly above a price.
Chart ranges
7d, 30d, 90d on a dashboard card.
Editor modes
Write and preview with icons.
What it handles for you
Tabs, toggle groups and segmented controls get mixed up; this is the single-choice one, with radio semantics and one tab stop.
One thrown thumb
Measured from layout, retargets mid-flight, first placement without motion.
Radio semantics
role="radiogroup", arrows select, one tab stop.
Icons or text
Icon-only segments take an ariaLabel.
Block
Equal segments that fill the parent.
Overview
Segmented controls usually blink their highlight from one segment to the next. Here the thumb is one surface thrown to the new segment with a slight overshoot while its width eases to the new label; it gives a little under the finger. It is a radiogroup, so arrow keys move and select.
States
- pick
- The thumb is thrown to the new segment (440ms, slight overshoot) and its width eases (400ms).
- press
- The thumb scales to 0.97 under the finger.
- keys
- Arrows move and select; Home and End jump.
Usage
Props
| Prop | Type | Description |
|---|---|---|
| options | SegmentOption[] | value, label, icon, ariaLabel, disabled. |
| value / defaultValue | string | Chosen value. |
| onValueChange | (value: string) => void | Called on choice. |
| label | string | Accessible name. |
| size | "sm" | "md"default "md" | 28px or 36px tall. |
| block | booleandefault false | Fill the parent with equal segments. |
Accessibility and motion
- Reduced motion: the thumb moves at once.
- Use Tabs when each choice shows its own panel.
Requirements
React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.
The CLI also installs ui-interaction-motion.
Source
Registry item: /r/segmented-control.json


