SegmentedControl
Pill container with multiple labeled segments - e.g. Light/Dark toggle, view-mode switcher.
Live preview
Time period
4 plain segments — Day / Week / Month / Year. Active segment = white pill + slate-900 text + shadow-sm; inactive = slate-500 text.
Theme picker
3 segments with persistent selection — Light / Dark / System. Common pattern for user-settings surfaces.
View mode (with icons)
Segments with leading icons — List / Grid / Map. Icon-only segments allowed; icon+label balance for compact toolbars.
Import & files
Import
import { SegmentedControl } from "@/components/ui/SegmentedControl";- Source file
components/ui/SegmentedControl.tsx
Spec
Spec Props · Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
options | { value, label, icon? }[] | - | — |
value | string | - | — |
onChange | (v: string) => void | - | — |
Usage
Container uses `bg-slate-50` (NOT `bg-slate-100`) per CORE §2.1. Active segment gets `bg-white shadow-sm`.
Figma note: Playground composition pattern - not a single Figma component category. See Playground source.
Examples
Examples 1
- 3-option selector (middle active)
AI context
AI context
Markdown summary safe to paste into Claude / ChatGPT / Cursor — includes name, status, import, props, axes, examples, figma source.
# SegmentedControlDomain: general · Category: navigationDesign: extension · Code: code-only
## DescriptionPill container with multiple labeled segments - e.g. Light/Dark toggle, view-mode switcher.
## Import```tsimport { SegmentedControl } from "@/components/ui/SegmentedControl";```Source: `components/ui/SegmentedControl.tsx`
## Props (3)| Prop | Type | Default | Description ||---|---|---|---|| `options` | `{ value, label, icon? }[]` | - | || `value` | `string` | - | || `onChange` | `(v: string) => void` | - | |
## UsageContainer uses `bg-slate-50` (NOT `bg-slate-100`) per CORE §2.1. Active segment gets `bg-white shadow-sm`.
## Examples- **3-option selector (middle active)**Related
Status legend
Status legend
- Stable
- Design + code shipped, full DS parity.
- Partial
- Design ready, some variants/states missing in code.
- Coded
- Implemented in code; design canon may not yet exist.
- Design only / Code only
- One side present; awaiting the other.
Phase 1.X-5.2 detail view — read-only metadata. Code preview + recipe + live demo deferred (need @dol/ui registry integration).