Components / component

Segmented Control

v1.0.0 · premium

A group of options with a thumb that slides to the selected one, built on real radio buttons.

Segmented Control demo

Implementation

A group of options with a thumb that slides to the selected one, built on real radio buttons.

Framework
React 19.3.1 with TypeScript
Motion
Native CSS and browser APIs. No GSAP required.
Available modes
build
Version
1.0.0 · published

Source code

Download source ZIP
export function SegmentedControl({ options, label, value, defaultValue, onChange, name, ink, paper, className }: {
  options: readonly SegmentOption[];
  /** Accessible name of the group, for example "Range". */

Quality evidence

Export tested in 2 consumer projects with chromium, firefox, webkit. Evidence recorded on .

Changelog

v1.0.0 · A group of options with a thumb that slides to the selected one, built on real radio buttons.

Frequently asked questions

Is it a real radio group?

Yes. The options are real radio inputs in a radiogroup, so the arrow keys move the selection and the value submits with forms.

How does the thumb find the selected option?

It measures the selected option and updates when the group resizes, so it stays correct at any width.