Simal UI
Components

SegmentTabs

A segmented tab strip: a muted track with a raised white pill on the active segment.

Web-only — segment-tabs.web.tsx has no native counterpart.

Segments size to their content rather than stretching to equal widths, so a long label like "Submit for review" never wraps. Arrow keys, Home and End move between segments; the strip is a real tablist.

Import

import { SegmentTabs } from '@simal/ui/nativewindui';

Props

PropValuesDefaultDescription
optionsOrdered segments. Each needs an id and label; badge adds a count pill, and is hidden when zero.
value"profile"The selected segment id. Controlled — the strip renders no selection of its own.
onChangeRequired. Receives the newly selected id.

Examples

With Badges

A badge carries a count. Zero is not rendered, so an empty tab looks clean rather than showing a 0.

Mixed Label Lengths

Segments size to their content, so mixed-length labels do not stretch to a common width.

Two Segments

Two segments is the minimum useful strip, and reads as a binary switch.

On this page