TabsPickerStyle

A picker style that presents options as segmented tabs.

StructureiOS 27.0+macOS 27.0+tvOS 27.0+visionOS 27.0+TabsPickerStyle in SwiftUI

Declaration

React
type TabsPickerStyle = SwiftOpaque<'TabsPickerStyle'>;
Swift
struct TabsPickerStyle

Overview

On macOS, this style produces a segmented picker with a visual treatment that distinguishes tab navigation from value selection. On iOS, tvOS, and visionOS, the visual appearance matches that of the standard standard .segmented style. On all supported platforms, VoiceOver announces options as tabs.

Picker("View", selection: $view) {
    Text("Events").tag(Views.events)
    Text("Reminders").tag(Views.reminders)
}
.pickerStyle(.tabs)

To apply this style to a picker, or to a view that contains pickers, use the View.pickerStyle(_:) modifier.

You can also use PickerStyle.tabs to construct this style.

From Apple’s SwiftUI documentation. Code samples there are Swift.

See also

More in Styles.