Skip to content
HomeCobalt

Segmented control

Chooses one of a few fixed options, as a radio group that changes state in place or as links that change the URL.

Examples

A radio group with one tab stop above the list it narrows; arrows move the choice, and the list answers at once.

4 filings

  • Northgate Credit2 days ago
  • Harbor Lane Partners6 days ago
  • Elm Street Value19 days ago
  • Westbrook Income27 days ago
Filling a narrow panelWith fill, the track takes the width of a narrow panel and each choice an equal share.
  • Harbour room9
  • Garden room6
  • Library4
Choices that change the addressEach choice is a link to the same page with the choice in its address, so it survives a reload and can be shared.
  • Northgate CreditOct 14, 2026
  • Harbor Lane PartnersOct 9, 2026
  • Elm Street ValueSep 30, 2026
Icons with their wordsIcons, each named by its word for the tooltip and the screen reader.
  • Harbour room12 seats
  • Library6 seats
  • Long table20 seats
  • Garden studio8 seats
In a sectionBeside a section heading, above what it changes.

Attendance

Forty people came this week.

Variants

  • Cayman Islands46
  • Delaware38
  • Ireland16
TrackThe default, a grey track with a white thumb, for a choice inside a page, a panel or a form.
GlassNo track, and the choice drawn as the nav's glass pill, 36px tall with the control corner (--r-control), for a control that sits in a bar beside a Nav, so the bar marks a choice one way.

Usage

Use it when

  • You pick exactly one of 2 to 4 fixed options and the choice shows at once: a range, a view, a sort, a theme.
  • The options are peers that fit on one line at 390px, each one word.

Use something else when

  • The choice switches panels of content below it. Use Tabs instead.
  • The choice is where you are in the app. Use Nav or NavTabs instead.
  • There are more than 4 options, or their labels run past 9 characters. Use Select instead.
  • The control is on or off. Use Switch or Pill instead.
  • Any number of options may be on at once. Use Checkbox, or a row of Pills, instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/segmented-control.json
import { SegmentedControl, type Segment } from "@/components/cobalt/ui/segmented-control"