Swift95

Picker95

A compact menu picker with classic disclosure and selection styling.

Picker95 presents typed values in a familiar collapsed control and preserves SwiftUI selection semantics.

Picker95 showing Name as the selected sort order
The compact closed picker rendered by the snippet below; activating it reveals both options.

Use it

import Swift95
import SwiftUI

struct Picker95Example: View {
  private enum SortOrder: Hashable { case name, dateModified }
  @State private var sortOrder = SortOrder.name

  var body: some View {
    Picker95(
      "Sort by",
      selection: $sortOrder,
      options: [
        PickerOption95("Name", value: SortOrder.name),
        PickerOption95("Date modified", value: SortOrder.dateModified)
      ]
    )
    .frame(width: 380)
  }
}

Essential behavior

SelectionThe tag type must match the selection binding type.
PresentationThe menu placement adapts to available space.
KeyboardRetains native focus and keyboard selection behavior.

Related

Open the complete Picker95 API reference →