Docs
Controls

Select MenuNew

A glass pill showing the current choice that opens in place into its list, the red row flowing to your pick before it closes.

$npx swiftpieces add SelectMenu
Free · MIT + Commons ClauseiOS 17.0+Liquid Glassselectmenupickerdropdownsortglasshaptics
Type
SelectMenu
Files
SelectMenu.swift
Depends on
Nothing (Apple frameworks only)
Version
1.0.0

Colors for SelectMenu. .standard is the house palette.

Notes

  • Takes any Hashable options with a label closure for their text, so an enum of sort orders, currencies or units drops straight in.
  • The closed pill shows the current value. Tapping it opens the glass in place into the list, a little slower than it closes, and the chevron turns over.
  • The selected row is a red pill. A new pick flows the red to it and the check follows, then the glass closes a beat later so the move reads, and the new value blurs into the pill.
  • The pill keeps its own height in your layout and the list opens over the views below it. If a later sibling draws on top, give the menu a higher zIndex.
  • One selection haptic fires per pick. VoiceOver reads the title and current value on the pill, and marks the selected row. .disabled(true) dims it.
  • Under Reduce Motion the glass opens and closes with short fades and the red slides without overshoot.

Usage

SelectMenuExample()

Install

Pick one. Run it from the folder that contains your .xcodeproj and the files land inside your app.

Terminal

$npx swiftpieces add SelectMenu

Or ask your coding agent · Claude Code, Cursor or Xcode, once the MCP server is connected

>Add the SwiftPieces "Select Menu" piece to my app

Or copy the source above into your app.

New to SwiftUI?If you know React, CSS or Tailwind, SwiftUI is easier to pick up than it looks.Try real app patterns first

Building a whole app? See SwiftPieces Pro →

All buttons and controls →

Build it yourself: SwiftUI motion guide · SwiftUI buttons guide · SwiftUI haptics guide

On this page

SwiftPiecesPro

Build the whole app with one library.

Production-ready screens, whole flows, complete app templates, a Build Kit your agent follows and Pro remixing.

Explore Pro