UI
SegmentedControl
Pill-style radio segments with size variants and full-width option.
Quick Preview
Installation
# No extra dependencies
// Copy component fromsrc/components/ui/SegmentedControl.tsx
Usage
import SegmentedControl from '@/components/ui/SegmentedControl'<SegmentedControlsegments={[{ value: 'list', label: 'List' },{ value: 'grid', label: 'Grid' },{ value: 'board', label: 'Board' },]}defaultValue="list"onChange={(value) => setViewMode(value)}/>
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
segments* | Segment[] | - | Array of {value, label, disabled?} |
size | 'sm' | 'md' | 'lg' | 'md' | Segment size |
fullWidth | boolean | false | Expand to container width |