SegmentedControl
Forms & Input

SegmentedControl

Inline mutually-exclusive picker; a compact alternative to Tabs for toolbar contexts such as time range or view mode switching.

Props

SegmentedControl renders as role="radiogroup" with role="radio" buttons.

SegmentedControlProps props
PropTypeDefaultDescription
optionsSegmentedControlOption[]—Available segments.
valuestring—Controlled value.
defaultValuestring—Initial uncontrolled value. Defaults to the first option.
onChange(value: string) => void—Selection handler.
size"sm" | "md""md"Control size.
classNamestring—Additional CSS class.
aria-labelstring—Accessible label for the radiogroup.

SegmentedControlOption has these fields:

SegmentedControlOption props
PropTypeDefaultDescription
valuestring—Unique option value.
labelReactNode—Display label.
iconReactNode—Optional icon before the label.
disabledboolean—Disables this specific segment.

Examples

Basic

Segmented control

With icons

Segmented control with icons

Sizes

Segmented control sizes
ImportTSX
import { SegmentedControl } from "@solarius/onset";
import type {
  SegmentedControlOption,
  SegmentedControlProps,
} from "@solarius/onset";