Knit UI
GitHub

Playground

Loading playground…

false
false
false
true
Playground
<SegmentedControl
  data={["React", "Vue", "Svelte"]}
  size="sm"
  orientation="horizontal"
  fullWidth={false}
  disabled={false}
  readOnly={false}
  withItemsBorders
/>

Examples

Sizes

The seven token sizes, from xxs to xxl.

Loading example…

SizesSourceStorybook

Shadows

The five shadow levels from the shared elevation ladder, from xs to xl.

Loading example…

ShadowsSourceStorybook

Disabled

Disabled state — the whole control becomes non-interactive with reduced opacity.

Loading example…

DisabledSourceStorybook

Disabled Item

A single item can be disabled while the rest remain interactive.

Loading example…

Disabled ItemSourceStorybook

Read Only

Read-only mode — the selected value is visible but cannot be changed.

Loading example…

Read OnlySourceStorybook

Vertical

Vertical orientation — segments stack top-to-bottom.

Loading example…

VerticalSourceStorybook

Controlled

Controlled value — the parent owns the state; selection triggers the callback.

Loading example…

ControlledSourceStorybook

Full Width

Full-width mode — the control stretches to fill the container.

Loading example…

Full WidthSourceStorybook

Rich Labels

Segments can accept arbitrary React nodes as labels, e.g. icons with text.

Loading example…

Rich LabelsSourceStorybook

Themed

The palette ramp follows the active theme — same control, different accent.

Loading example…

ThemedSourceStorybook

Styles

Per-slot styles targets individual parts — here the root track and the label.

Loading example…

StylesSourceStorybook

Props

PropTypeDefaultDescription
data required(string | SegmentedControlItem)[]Options to render — bare strings or `{ value, label, disabled }`.
autoContrastboolean | undefinedAccepted for API parity; ramp already contrasts, so this is a no-op.
defaultValuestring | undefinedUncontrolled initial value.
disabled systemboolean | undefinedfalseDisable the whole control.
fullWidth systemboolean | undefinedfalseStretch to fill the parent's width.
namestring | undefinedAccessibility group name (parity).
onChange((value: string) => void) | undefinedCalled when the selected value changes.
orientationSegmentedControlOrientation | undefined
horizontal · vertical
"horizontal"Layout direction of the segments.
radius systemstring | number | undefined
readOnlyboolean | undefinedfalsePrevent changing the value (still selectable for display).
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
unset · xs · sm · md · lg · xl
Elevation — drop shadow from the shared ladder.
size system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
xxs · xs · sm · md · lg · xl · xxl
"md"Controls height, horizontal padding and font size.
styles systemSlotStyles<SegmentedControlSlots> | undefinedUniform per-slot style passthrough — sugar over the parts. Slots: `root` / `control` / `label`. Lowest precedence: explicit props on the parts win.
theme systemThemeName | null | undefined
unset · blue · red · green · yellow · pink · gray
Active theme accent — recolors the control via the palette ramp.
transitionDurationnumber | undefined200Indicator slide duration in ms.
transitionTimingFunctionstring | undefined"ease"Indicator slide easing (`"ease"`, `"linear"`, `"ease-in-out"`, …).
valuestring | undefinedControlled value.
withItemsBordersboolean | undefinedtrueDraw thin separators between items.

Style slots

Every part of SegmentedControl can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotUsage
controlstyles={{ control: { … } }}
labelstyles={{ label: { … } }}
rootstyles={{ root: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 497 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.