Segmented control

A row of options with one raised thumb that slides to the choice. It is a real radio group: arrow keys move the choice.

Install it the shadcn way: copy the source file into your project. It uses CSS 3D, Tailwind CSS v4 and Framer Motion, no WebGL.

SegmentedControl3D props

PropTypeDefaultDescription
optionsSegmentedOption<T>[]The choices to show, each with a value, label and optional disabled flag.
valueTSelected option value. Set it to control the component.
defaultValueTOption selected at first when uncontrolled. Defaults to the first enabled option.
onValueChange(value: T) => voidCalled with the new option value whenever the choice changes.
size"sm" | "md" | "lg""md"Control height and text size: "sm", "md" or "lg".
fullWidthbooleanStretch to the full width and share it equally.
aria-labelstringRequired: names the group for screen readers.
classNamestringExtra classes added to the outer element.

More components

Guides

Start

Cards

Scenes

Controls & text

Buttons

More cards

UI elements

Form controls

App components

Text & backgrounds

Showpieces

Blocks