Segmented

A group of segments that act as a single-choice selector. Zero DOM measurement. The indicator slides using pure CSS custom properties for maximum performance.

Playground
size
activeBold
disabled
block
rounded
background
activeBg
textColor
activeTextColor
<Segmented/>

Basic

With Icons

Pass icon as a ReactNode in the option object. The icon is rendered before the label.

Icon Only

Omit the label to get compact icon-only segments.

Sizes

Block

Stretch the control to fill its container width. Each segment takes equal space.

Disabled

Disable the whole control or individual segments.

Rounded Variants

Controlled

Use value + onChange for full control. The component reports only the value, no event object.

Selected: daily

API

PropertyTypeDefaultDescription
optionsSegmentedRawOption[]List of segments. Each item can be a string/number or an object with label, value, disabled, icon.
valuestring | numberControlled selected value.
defaultValuestring | numberoptions[0]Uncontrolled initial value. Defaults to the first option.
onChange(value: string | number) => voidCalled when the active segment changes.
size"sm" | "md" | "lg""md"Height and font-size preset.
disabledbooleanfalseDisable every segment at once.
blockbooleanfalseStretch the control to fill its container width.
backgroundstringBackground color of the track.
activeBackgroundstringBackground color of the active indicator.
textColorstringText color of inactive segments.
activeTextColorstringText color of the active segment.
activeBoldbooleanfalseBold the active segment label.
rounded"none" | "sm" | "md" | "lg" | "full"Border-radius override.

SegmentedOption

PropertyTypeDefaultDescription
valuestring | numberUnique identifier for this segment.
labelReactNodeDisplay content of the segment.
disabledbooleanfalseDisable only this segment.
iconReactNodeIcon rendered before the label.