Segmented Control
segmented-controlA row of mutually exclusive options whose selected pill moves between them on a spring. It behaves as a radio group, with one tab stop and arrow keys that move the selection, and reduced motion turns the spring into a cut.
"use client";
import { Columns3, List, Rows3 } from "lucide-react";
import { useState } from "react";
import { SegmentedControl } from "@/components/forme/segmented-control/segmented-control";
export function SegmentedControlDemo() {
const [range, setRange] = useState("week");
return (
<div className="flex flex-col items-start gap-5">
<SegmentedControl
label="Date range"
value={range}
onValueChange={setRange}
options={[
{ value: "day", label: "Day" },
{ value: "week", label: "Week" },
{ value: "month", label: "Month" },
{ value: "year", label: "Year" },
]}
/>
<SegmentedControl
label="Layout"
size="sm"
options={[
{ value: "list", label: <List aria-hidden />, "aria-label": "List" },
{ value: "board", label: <Columns3 aria-hidden />, "aria-label": "Board" },
{ value: "table", label: <Rows3 aria-hidden />, "aria-label": "Table" },
]}
/>
<p className="text-caption-1-regular text-muted-foreground">Showing this {range}.</p>
</div>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
Usage
import { SegmentedControl } from "@/components/forme/segmented-control/segmented-control";
<SegmentedControl
label="Range"
defaultValue="week"
options={[
{ value: "day", label: "Day" },
{ value: "week", label: "Week" },
{ value: "month", label: "Month" },
]}
/>When to use
Reach for it
- Two to five mutually exclusive views of the same content: Day, Week, Month or List, Board.
Use something else
- Options that lead to different pages or panels with their own content — use
Tabs. - More than five options, or long labels; use a
Select.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
SegmentedControl
A small set of mutually exclusive views — Day / Week / Month, List / Board.
| Prop | Type | Default | Description |
|---|---|---|---|
options* | readonly SegmentedOption[] | — | |
label* | string | — | Accessible name for the group. |
value | string | — | |
defaultValue | string | — | |
onValueChange | (value: string) => void | — | |
size | "sm" | "md" | "md" | |
className | string | — |
Accessibility
- It is a radio group: one tab stop, and the arrow keys move and select.
- An option whose label is only an icon needs its own
aria-label.
Motion
- The selected pill travels between options on a shared layout spring, which says “the same control, a new value”.
- Reduced motion turns the spring into a cut.
Related


Confirm Button
A destructive button that grows into its own confirmation on a spring, so the question appears where you are looking. Focus lands on Cancel, Esc or clicking away disarms it, and the confirm button shows a spinner while the action runs.
motion

Dynamic Island
A black pill that morphs on a spring to fit whatever it is showing: a timer, a call, a song or a notification. Content swaps through a short blur crossfade, the corners never stretch mid-morph, and each change is announced politely.
motion

Marquee
A seamless, endlessly scrolling row for logos, photos or testimonials. It pauses on hover and focus, screen readers hear the content once, and reduced motion turns it into a row you scroll by hand. Pure CSS.
motion