Overview
SegmentedControl styling is split across the root track, item-level content, and the animated indicator. The indicator follows the checked segment through CSS anchor positioning — no JS measurement.
Public CSS Variables
| Variable | Value | Affects |
|---|---|---|
Overall control height.SegmentedControl | No visible change in this state | |
Track background.SegmentedControl | No visible change in this state | |
Radius ratio of the control.SegmentedControl | No visible change in this state | |
Default item background on hover.SegmentedControl | No visible change in this state | |
Default item background while pressed.SegmentedControl | No visible change in this state | |
Item text color.SegmentedControlItem | No visible change in this state | |
Item background.SegmentedControlItem | No visible change in this state | |
Item background on hover.SegmentedControlItem | No visible change in this state | |
Item background while pressed.SegmentedControlItem | No visible change in this state | |
Background of the selected item.SegmentedControlItem | No visible change in this state |
Part-Level Variables
SegmentedControl: root track, size model, and focus outline.SegmentedControlItem: label sizing, padding, and active or disabled text treatment. The active segment is the one whose radio is checked — target it with:has(input:checked).SegmentedControlIndicator: animated selected-state surface.SegmentedControlItemInput: semantic carrier for native radio-group behavior.
State And Variant Interaction
sizechanges height, font size, and padding model.variantchanges the indicator color family.- Disabled state affects both the item styling and the indicator appearance.
Examples
.compactSegments {
--segmented-control-height: 32px;
}.brandSegments {
--segmented-control-background-color: var(--fills-secondary);
}Do Not Override
- Do not hard-code indicator geometry:
leftandwidthcome from the checked segment's anchor. - Browsers without CSS anchor positioning hide the indicator and paint the checked segment's own background instead.
- Do not weaken root focus visibility.
- Do not force very uneven item padding if labels already vary in length.