A choice between a few options in one row
The name sits on the left and the options as chips at the bar’s end. The selection is SegmentedControl’s: an action-colour pill that slides from chip to chip. Each option is a native radio, so the set announces as one radiogroup named by the label, arrow keys move the selection, and it submits with a form.
Sizes
The size prop matches Button’s: default is 40px tall and compact is 32px.
Disabled option
Set disabled on one option to take that choice out of the set while the others stay available.
Disabled
When to use it
Use the inspector segmented control for a setting with two to four short options in a dense panel, usually inside an inspector section. For a free-standing pill strip in a form or a toolbar, such as a view switcher, use Segmented control instead.
Props
Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.
| Prop | Type | Default | Description |
|---|---|---|---|
label* | string | The setting's name, drawn inside the bar on the left. Names the radiogroup. | |
options* | InspectorSegment[] | The choices, drawn left to right in the bar's end. | |
value | string | The selected value (controlled). Leave unset and use `defaultValue` for an uncontrolled set. | |
defaultValue | string | The starting selection for an uncontrolled set. | |
name | string | The radios' shared `name`, for native form submission. Generated when unset. | |
disabled | boolean | false | Takes the whole set out of use. |
size | "default" | "compact" | 'default' | Component size, matching Button: `default` is 40px tall, `compact` 32px. |
onValueChange | ((value: string) => void) | Called with the newly chosen value. | |
className | string | '' | Additional CSS classes, applied to the bar. |
Keys
Native radio inputs: the browser moves between them with the arrow keys. Those keys belong to the platform, so no test of this library presses them.
// From the npm package
import { InspectorSegmentedControl } from 'rift-ds/components/InspectorSegmentedControl/InspectorSegmentedControl';
// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/inspector-segmented-control.json1.0 kB gzipped, with everything it imports. Peer dependencies are not counted.
For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.