iPhone SwiftUI layouts

Explore interactive SwiftUI previews across every available iPhone screenshot variant.

Picker

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.

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)
    }
}
iOS 17.0+ iPadOS 17.0+ macOS 14.0+ visionOS 1.0+

Every available iPhone screenshot for PalettePickerStyle.

2 views