SettingsUnifiedSegmentedRow
Full-width segmented control whose outer corners follow the enclosing card's curvature.
@MainActor struct SettingsUnifiedSegmentedRow<Option, Content> where Option : Hashable, Content : View
groupPosition is a required parameter on purpose: the correct value depends on what sits above and below the row in the card, and a wrong default renders a broken corner against a straight divider. Look at the card before you pick.
Initializers
init(options:cornerRadius:groupPosition:segmentHeight:accessibilityLabel:isEnabled:isSelected:action:content:)
@MainActor init(options: [Option], cornerRadius: CGFloat = DroppyRadius.large, groupPosition: SettingsGroupPosition, segmentHeight: CGFloat = 34, accessibilityLabel: String, isEnabled: @escaping (Option) -> Bool = { _ in true }, isSelected: @escaping (Option) -> Bool, action: @escaping (Option) -> Void, @ViewBuilder content: @escaping (Option, Bool) -> Content)
Creates a segmented row.
- Parameters:
- options: The options, leading to trailing.
- cornerRadius: Outer radius, normally
largeto match the card. - groupPosition: Where the row sits in the card. Required.
- segmentHeight: Track height. 34 is the established full-width segmented track height; only inline trailing pills use the 24pt compact metric.
- accessibilityLabel: Label for the whole control.
- isEnabled: Per-option enablement.
- isSelected: Per-option selection state.
- action: Selection handler.
- content: Segment label builder, receiving the option and its selected state. Use
settingsUnifiedSegmentLabel(icon:title:isSelected:isEnabled:).
Properties
body
@MainActor var body: some View { get }