Components · FormNot verified with Figma

Pill segment control

A pill segment control switches between two to four related views or filters in the same surface. A pill slides to the active segment.

Tokens, sizes, measurements, states and requirements. Values come from the live token package and from the specification skill: Pill segment control.

Design Tokens

Resolved from the live token package.

StatePartTokenValue

Open points: the Primary Inverted variant (for black surfaces) and the Square shape are in the Figma spec but not specified or built. The Disabled state must be pulled from Figma (State=Disabled) before it is built. The component is not yet compared against the Figma design.


Sizes

SizeDesktop (769px+)Mobile and tabletUsed for
Large56px · padding 5px · radius 28px · pill padding 24px · 18/18, 0.18px48px · 4px · 24px · 20px · 16/16, 0.32pxPage-level view switcher
Medium48px · 4px · 24px · 20px · 18/18, 0.18px40px · 4px · 20px · 16px · 16/16, 0.32pxView switcher in a drawer
Small40px · 4px · 20px · 16px · 16/16, 0.48px32px · 3px · 16px · 12px · 14/14, 0.42pxSecondary filters
XSmall32px · 3px · 16px · 12px · 14/14, 0.56px32px · 3px · 16px · 10px · 12/12, 0.48pxCompact filters in a table toolbar

Columns: height · track padding · track radius · pill padding · text. The track radius is always half the height; the pill radius is the track radius minus the track padding. sm (640–768px) still has the mobile size.


Measurements

Dimensions

Padding of the track at each size: the space between the track and the pill. The numbers are read from the component.

Breakpoint
The track at true size (1:1). Change the Breakpoint to see the mobile values.
AttributeLargeMediumSmallXSmall
Height, Desktop56px48px40px32px
Height, Mobile48px40px32px32px
Track padding, Desktop5px4px4px3px
Track padding, Mobile4px4px3px3px
Pill padding (left, right), Desktop24px20px16px12px
Pill padding (left, right), Mobile20px16px12px10px
Track radiusHalf the height
Pill radiusTrack radius minus the track padding

Spacing

The spacing values as tokens.

PartValue
Track padding 4pxspace-4
Track padding 3px and 5pxLiterals: no spacing token for 3px and 5px
Pill padding 12px, 16px, 20px, 24pxspace-12, space-16, space-20 (literal), space-24; 10px is a literal

The segment padding is set in the CSS in pixels. Open point: bind 3px, 5px, 10px and 20px to tokens or add them to the spacing scale.


States

Hover darkens the track to border-tertiary and underlines the inactive segment. Focus has no style of its own: the buttons use the global keyboard focus ring. Hover is forced on this page.

StateControlRule

Typography

SizeTypeDesktop (769px+)Mobile and tablet
Largelabel-lg18/18, 0.18px16/16, 0.32px
Mediumlabel-lg18/18, 0.18px16/16, 0.32px
Smalllabel-md16/16, 0.48px14/14, 0.42px
XSmalllabel-sm14/14, 0.56px12/12, 0.48px

Breuer Condensed, weight 600, uppercase, with ss02 and ss03.


Structure

Elements

ElementClassNotes
Trackpill-segment-control, --md, --sm, --xsrole="group" with an aria-label. Large is the default.
Pillpill-segment-control__thumb, --lightA separate element. pill-segment-control.js sets its width and translateX.
Segmentpill-segment-control__btn, --activeA button with aria-pressed.

Types

TypeClassUse
Black pillDefaultOn light surfaces.
White pillpill-segment-control__thumb--lightWhen the control already sits on a dark or grey surface.
Primary Inverted—In Figma, not built.
Square shape—In Figma, not built.

Width

Fluid (width: 100%) only below 640px, where the segments share the space evenly. From 640px it shrinks to its content (width: auto, align-self: flex-start). Count: two to four short options on one row.


Motion

PropertyDurationEasing
Pill: transform and widthduration-medium-2 (300ms), set through --sg-durationease-standard, set through --sg-ease
Track background-color on hoverduration-fast-3ease-standard
Segment text colorduration-fast-3ease-standard

The pill travels a visible distance, so it is slower than a hover. Compare other easing and duration values in the live Motion section on Examples & Guidelines.


Behavior

TopicRule
Sliding pillThe pill is its own .pill-segment-control__thumb. pill-segment-control.js sets its width and translateX from the active button’s offsetWidth and offsetLeft, because the buttons can have different widths. It re-measures on resize and load.
EventA bubbling segment-change event with detail.button.
Count2–4 short options on one row. More: eco-select or eco-radio.
DisabledNot specified. Pull State=Disabled from Figma before building it.

Accessibility Requirements

TopicRequirement
Markuprole="group" with an aria-label; the buttons carry aria-pressed.
FocusNo own style: the buttons use the global focus ring on keyboard focus (border-focus). Never add a second ring (WCAG 2.4.7).
ColorThe active segment is also shown by the pill, not by color alone.
MotionReduced motion: the pill slide should be turned off. Open point: the CSS does not yet have a prefers-reduced-motion rule.