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
4 filings
- Northgate Credit2 days ago
- Harbor Lane Partners6 days ago
- Elm Street Value19 days ago
- Westbrook Income27 days ago
- Harbour room9
- Garden room6
- Library4
- Harbour room12 seats
- Library6 seats
- Long table20 seats
- Garden studio8 seats
Attendance
Forty people came this week.
Variants
- Cayman Islands46
- Delaware38
- Ireland16
--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.jsonimport { SegmentedControl, type Segment } from "@/components/cobalt/ui/segmented-control"Related
- ChipRownarrows a list to one of any number of choices.
- Togglekeeps a tool pressed or not, such as bold in a toolbar or "Show archived" beside a list.
- RadioGroupone choice among options that need a description, saved with a form.
- FilterBarfilter pills over a list, each naming what is chosen, that fold into one sheet on a phone.
