PalettePickerStyle
A picker style that presents the options as a row of compact elements. When used outside of menus, this style is rendered as a segmented picker. If that is the intended usage, consider segmented instead.
Platform Compatibility
iOS 17.0+ iPadOS 17.0+ macOS 14.0+ visionOS 1.0+
Tags
SwiftUI Code
List {
Menu("Test") {
Picker(selection: $selection) {
Text("1")
.tag("1")
Text("2")
.tag("2")
Section("Bar") {
Text("3")
.tag("3")
Text("4")
.tag("4")
}
Label("5", systemImage: "5.circle")
.tag("5")
Label("6", systemImage: "6.circle")
.tag("6")
} label: {
Label("Foo", systemImage: "hand.tap")
Text("Bar")
} currentValueLabel: {
Text("Selected: \(selection)")
}
.pickerStyle(.palette)
}
}Found an issue or have a suggestion?
Created: April 5, 2026Updated: April 5, 2026