Segment
A segmented control for switching between mutually exclusive options - the active indicator slides with a spring. Choose the filled pill or the underline style, and give options a content panel to turn it into a tab group.
Installation
npx stepwise-ui add segment
Underline
With panels (tabs)
Add a content to each option and Segment renders the active panel below with a blur-fade - a full tab group, no separate component.
Usage
Props
PropTypeDescription
optionsSegmentOption[]Array of { value, label, icon?, content? }. content turns it into a tab group.
valuestringControlled selected value. Pair with onChange.
defaultValuestringUncontrolled initial value. Defaults to the first option when omitted.
onChange(value) => voidCalled when the user selects a different option.
variant"pill" | "underline"pill → filled sliding pill (default) | underline → sliding underline.
size"sm" | "md"sm → 28 px buttons | md → 32 px buttons (default).
classNamestringApplied to the wrapper.