Component packs › Toolbelt › Segmented Control
Tap a segment and the thumb springs over, or drag and throw it with a rubber-band at the ends.
Segmented Control is a control from Toolbelt, a component pack with 6 toolbar components: Toolbars, menus and tab bars with one highlight that springs from tool to tool. Price: $2 for the whole pack.
Built with: 1:1 drag, throw to snap, radio group.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
options | string[] | ||
value | number | ||
label | string | ||
dark | boolean | follows the page | Force the dark (true) or light (false) look. Default: follows the page. |
onChange | (index: number) => void | ||
autoplay | number | false | Showcase mode: moves to another segment every N ms while visible. |
readonly value: numberselect(i: number): voiddestroy(): voidimport SegmentedControl from './SegmentedControl';
<SegmentedControl />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Menus and popovers.