Segmented
COMPONENT

CONTROLS / SEGMENTED

Segmented

Native macOS segmented control for switching tabs, time ranges (Day / Week / Month), or filters cleanly inside a widget — pairs smoothly with useState or useSetting.

Signature#

SIGNATURE
<Segmented
  value={range}
  onChange={setRange}
  options={[
    { id: "day", label: "Day" },
    { id: "week", label: "Week" },
    { id: "month", label: "Month" },
  ]}
/>
3-Segment Control
Interactive

Props#

Inherits StyleProps:

optionsSegmentOption[]Required
Array of { id: string, label: string, icon?: string } items (icon is an optional SF Symbol name).
valuestringRequired
Currently active segment id.
onChangefunctionOptional
Callback (id: string) => void fired when the selection changes.

Example: Segmented Chart Switcher#

TSX
<VStack spacing={10}>
  <Segmented
    value={range}
    onChange={setRange}
    options={[
      { id: "day", label: "Day" },
      { id: "week", label: "Week" },
      { id: "month", label: "Month" },
    ]}
  />
  <Chart kind="area" values={SERIES[range]}
    color="theme.accent" />
</VStack>
Segmented + Live Chart
Interactive
Activity 79