Segmented Control

iOS-style segmented control. The active pill slides between options with a slight spring.

Import

import { SegmentedControl } from "@igorao79/uivix";

Examples

Controlled

Showing stats for: week

Sizes

Full width

Props

PropTypeDefaultDescription
optionsSegmentedOption[]-{ value, label } for each segment
valuestring-Controlled value
defaultValuestringfirst optionInitial value when uncontrolled
onChange(value: string) => void-Called on change
size"sm" | "md" | "lg""md"Size
fullWidthbooleanfalseStretch to the container width
classNamestring-Additional CSS classes