Segmented

Segmented button with Material SegmentedButton anatomy in Lozenge tokens, on a native radio group (zero JS; arrow keys are the platform's): a single hairline outline around the group, shared divider lines between segments, full stadium ends, transparent unselected segments, and a leading checkmark that animates in on the selected segment. .segmented-bold fills the selection with accent-bold; .segmented-compact is 24px.

Root: .segmented on <fieldset>

Examples

Example 1
<fieldset class="segmented" aria-label="View"><input type="radio" name="view" id="view-board" checked><label for="view-board">Board</label><input type="radio" name="view" id="view-list"><label for="view-list">List</label><input type="radio" name="view" id="view-timeline"><label for="view-timeline">Timeline</label></fieldset>
Example 2
<fieldset class="segmented segmented-bold segmented-compact" aria-label="Density"><input type="radio" name="density" id="d-cozy" checked><label for="d-cozy">Cozy</label><input type="radio" name="density" id="d-compact"><label for="d-compact">Compact</label></fieldset>

Contract

Variants & modifiers

ClassAxisRules
segmented-boldemphasisoptional · exclusive
segmented-boldmodifieroptional
segmented-compactmodifieroptional

Structure

SelectorRequiredDescription
input[type=radio]requiredVisually-hidden radios as DIRECT children of the fieldset. All share one name (unique per group on the page); exactly one carries checked. Each label must be the immediate next sibling of its radio — the CSS selects input:checked + label.
labelrequiredOne <label> per segment, immediately following its radio, with for matching that radio's id. Labels are the visible segments; first/last get the outer corner radii.

Accessibility

OnAttributeLevelWhen
.segmentedaria-labelrequired

Keyboard support is native radio-group behavior: Tab enters the group, arrow keys move the selection (which is also the activation) — add no ARIA roles on top of the radios. The fieldset provides the grouping; aria-label names it (a visually-hidden <legend> also works, but keep the aria-label for the lint contract). Focus shows a ring on the focused segment's label. Disable a single segment by disabling its input.

Nesting

Allowed in:

  • toolbars
  • card headers
  • filter rows
  • forms

Never inside (or containing):

  • .segmented
  • .btn-group