Playground
Size
Basic
Sizes
Two segments
Disabled Segment
Timeline is disabled here (e.g. a plan-gated view) — Arrow key navigation skips over it.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| options | { label: string; value: string; disabled?: boolean }[] | — | 2–4 segments; individual segments can be disabled. |
| value | string | — | The selected option's value (controlled). |
| onChange | (value: string) => void | — | Called when a segment is selected, by click or arrow-key navigation. |
| size | "sm" | "md" | "md" | Controls padding and type size. |
| className | string | — | Extra classes on the root. |
Usage Guidelines
When to use
- Use for switching between 2-4 mutually exclusive views where every option should stay visible at once — List/Board/Timeline, time ranges.
When not to use
- Don't use for more than four options — it gets cramped; use Tabs or Select instead.
- Don't use it for one-off actions — it's a view-state switch, not a set of commands.