Skip to main content
InputLevel 2

Segmented Control

分段控件

WebMobileDesktopDifficulty: Medium

A row of small buttons packed shoulder to shoulder, one of them selected, so the control looks "segmented".

01

Live Demo

Actually clickable

Currently showing: today cleanup records

A compact button group. How it differs from Tabs: switching here doesn't change the URL.

What you just saw:The Day / Week / Month control at the bottom of the iOS Photos viewer, the segmented button on a Mac, the List / Map toggle in a maps app.

02

What it actually is

A segmented control is a compact button group where the selected segment gets a filled highlight. The key distinction: it looks a lot like tabs, but a segmented control switches between small views of the same content rather than between different pages.

segmented controlsegmentedsegmented buttonbutton grouptoggle group
03

Anatomy · What it's made of

  1. Track外框

    Light gray background wrapping all segments

  2. Segment分段

    Equal width or sized to content

  3. Selected选中

    White fill plus a shadow

  4. Label文字

    One to four words is ideal

04

When to Use

When it fits, and when it doesn't
Segmented Control usage recommendations
SituationUse it?
Switching between two and four viewsYes
All the options are very short (one to four words)Yes
You want the control to hug its content instead of spanning full widthYes
Each option needs its own URLNo
The option labels vary a lot in lengthDepends

If each view needs to be shareable or bookmarkable (its own URL), use Tabs.

Wildly different label lengths make the segments look broken — either use icons uniformly or switch to a Select.

05

Similar Patterns

Don't mix these up
Full comparisonTabs vs Segmented ControlI have a set of options to switch between. Tabs or Segmented Control?See the table
06

How to tell AI

Three levels of prompt

Add the component name and specifics

Add a Segmented Control with three segments — Day / Week / Month — where the selected item has a white fill and a subtle shadow. Switching only affects the same region of the page and never changes the URL.

07

Don't just say this to AI

Bad → Better

Don't say this to AI

Add a few buttons that toggle.

Say this instead

Add a Segmented Control: two to four segments inside a light gray track, the selected one with a white fill and a shadow, the sliding pill animated with transform, expressed with role=tablist/tab plus aria-selected, and never changing the URL.

08

Share this card

Social-ready

Turn this pattern into a 3:4 or 1:1 knowledge card and export it as PNG right in the browser. No backend needed.