Segmented Control

Compare Segmented Control for React and React Native in VLLNT UI 0.4.0. Explore source, dependencies and native capabilities. Native is source-only; npm publication is pending.

Supported platforms:WebNative
Report a bug

What it is and when to use

Segmented Control is a single-choice selector that lets users switch between a small set of options, such as modes, views, or filters. Built on Radix Toggle Group, it renders a SegmentedControl with SegmentedControlItem children, exposes value, defaultValue, and onValueChange for controlled or uncontrolled use, and supports sm, default, and lg sizes. The active segment is highlighted, individual items can be disabled, and keyboard focus is handled for you.

Form

Preview

Switch between light and dark to inspect the embedded Storybook preview.

Single-choice segmented selector for switching modes, views, or filters. Part of the form family in VLLNT UI, it ships as a machine-readable registry entry — copy the source directly into your app with the shadcn CLI and own it, no runtime dependency on a component library.

Platform comparison

PlatformDependenciesCapabilities
Web@vllnt/ui@^0.3.0Browser rendering, DOM events, and ARIA semantics
Native@vllnt/ui-native, react-nativeNative-adapted interaction and accessibility

Installation

Add Segmented Control to your project with the shadcn CLI. The source lands in your codebase, ready to adapt:

pnpm dlx shadcn@latest add https://ui.vllnt.com/r/segmented-control.json

Source

Stories

Explore every variant and state in the interactive Storybook:

FAQ

What is Segmented Control?
Segmented Control is a React single-select component from VLLNT UI, built on Radix Toggle Group. It groups related options into one control so users pick exactly one, ideal for toggling views, modes, or filters.
How do I add Segmented Control?
Run `pnpm dlx shadcn@latest add https://ui.vllnt.com/r/segmented-control.json` to install Segmented Control via the shadcn CLI. The component source is copied into your project so you can restyle the segments.
Is Segmented Control controlled or uncontrolled?
Both. Use value with onValueChange for a controlled component, or defaultValue for uncontrolled state. It allows only a single active option and offers sm, default, and lg size variants.