Skip to content

Reference

an-segmented-control

A row of mutually exclusive options — a UISegmentedControl, a MaterialButtonToggleGroup, an NSSegmentedControl.

Three or four choices, all visible at once, one of them selected. Where a an-select hides the options until you open it, this one shows them.

On the Mac it is also what an-tab-bar becomes, because an NSSegmentedControl is what Mac apps actually use to change section.

iOS · iPadOS Android macOS tvOS visionOS watchOS Wear OS
iOS · iPadOS Android macOS watchOS
UISegmentedControl MaterialButtonToggleGroup NSSegmentedControl
Prop Type Default
items readonly string[] | null null
selectedIndex number | null 0
color string | null null
Output Payload
(change) { index: number }
<an-segmented-control
[items]="['Day', 'Week', 'Month']"
[selectedIndex]="range()"
(change)="range.set($event.index)" />

Every primitive also carries the base props — background, border, opacity, the transforms, animate, the accessibility contract — and every gesture. See Components for the full base, Events for the payloads.