One connected control, one selected segment — a segmented control
Segmented Control
/ NSSegmentedControl · PickerStyle.segmented /
also called segment control, segmented picker, button group
A segmented control groups a small set of related choices into one horizontal row of connected buttons. The selected segment receives a pressed or filled appearance, making the current mode immediately visible. NSSegmentedControl can also be configured for multiple or momentary tracking, but a segmented Picker normally represents one persistent selection.
Anatomy — every part, named
- 1Selected segment
NSSegmentedControl.selectedSegment“The section that stays pressed” is the selected segment.
- 2Segment divider
NSSegmentedControl“The little line separating two choices in the pill” is a segment divider.
Prompt — paste into your agent
Use a Segmented Control with NSSegmentedControl (SwiftUI: a Picker with PickerStyle.segmented), showing the active segment with the native selected treatment. Keep the buttons connected as one control and bind selection so exactly one segment remains selected for this view switcher.
In code
The exact names this thing goes by in code — each row is one framework’s word for it. Use the row that matches your project (or paste it into your prompt).
| AppKit | NSSegmentedControl | |
| SwiftUI | PickerStyle.segmented | |
| AppKit | NSSegmentedControl.trackingMode | single, multiple, or momentary selection behavior |
| SwiftUI | View.pickerStyle(_:) |