ttolbel UI

Component

Segmented control

A row of mutually exclusive text options with a glowing dot that magnet-slides beneath whichever one is active.

Standalone

segmented control.tsx
<NativeSegmentedControl
  options={[
    { label: "Day", value: "day" },
    { label: "Week", value: "week" },
    { label: "Month", value: "month" },
  ]}
  value={value}
  onValueChange={setValue}
/>

Example

Switches the time range above a chart or metrics view, redrawing the instant a new segment is selected.

segmented-control-example.tsx
<NativeSegmentedControl options={rangeOptions} value={range} onValueChange={setRange} />
<BalanceChart range={range} />

Capabilities

PropTypeDescription
optionsrequiredNativeSegmentedControlOption[]-
valuerequiredstring-
onValueChangerequired(value: string) => void-
surfaceNativeSegmentedControlSurface-
classNamestring-
scrollYMotionValue<number>Optional scroll position. When provided, the control compresses as the user scrolls up.