Docs
Glass

Glass Action Menu

Hold the glass trigger and its actions bud out of it along a line or an arc; slide across them and release to fire one.

$npx swiftpieces add GlassActionMenu
Try it in the Playground Use it on a real screen, take it apart, remix it, and copy the SwiftUI. No account needed.
Free · MIT + Commons ClauseiOS 17.0+Liquid Glassmenuglassmorphfablong-presshaptics
Type
GlassActionMenu
Files
GlassActionMenu.swift
Depends on
Nothing (Apple frameworks only)
Version
2.3.0
In a full screen · SwiftPieces ProReaderA long-read article with a serif headline and a floating pill that morphs into a reading toolbar.

Floating liquid glass action menu with a hold-slide-release gesture, a dimming scrim and a confirming trigger. The trigger and its actions are glass bubbles in one liquid group. The actions rest apart, from the trigger and from each other. Opening, each one buds out of the trigger: born inside it, it pulls a liquid neck that thins and snaps as it springs to its place, and its name buds from its side and stays joined to it by a neck. Closing, the names melt into their actions and the actions melt home, farthest first; after a fire the chosen action melts home last.

Notes

  • Two ways in: a tap toggles the menu, a 350ms hold expands it and keeps the same touch live, so you can slide across items (each crossing lifts the item and ticks .selection) and release to fire. Releasing a hold on empty space leaves the menu open. A touch the system cancels lets go without firing.
  • Liquid glass throughout: the trigger, the actions and their names are glass shapes in one liquid group (GlassEffectContainer on iOS 26). The actions rest apart, 26pt from the trigger and from each other, so each is its own bubble; a name rests joined to its action, 6pt off its side, so a liquid neck holds them together.
  • The trigger leads: it sinks under the finger without bouncing, springs back on release and turns to a close mark on a crisp snap. The actions then bud out of it, 50ms apart: each is born inside the trigger, shrunk, and springs out to its place on the split spring, pulling a neck that thins and snaps as it goes. Each name buds from its own action 160ms later, squeezed narrow inside the action and stretching out to full width.
  • Closing: the names melt into their actions first, then the actions melt home, farthest first, 40ms apart, on a spring with no bounce, so none pokes out through the far side of the trigger. A bubble's icon or name blurs away the moment it heads home, and a tinted action drains to clear glass as it melts in, so nothing sits on top of the trigger's symbol.
  • A hovered item lifts with a little elastic give and leans a few points toward the finger on its tether. The lean is visual only; hits always use the items' resting positions.
  • Firing: the rigid haptic lands on release, the item swells, and its action runs 140ms later. The other actions melt home first and the chosen one melts in last, still swollen; the trigger's close mark blurs into a checkmark as it arrives and holds it for 0.9s (Style.confirmsAction). No second haptic.
  • The scrim is an oversized background behind the trigger; it dims everything beneath the menu in its parent and dismisses on tap. It fades with the menu and lets taps through as soon as the menu starts to close. Place the menu last in a ZStack so nothing sits above it.
  • Phases: collapsed, expanding, open, hovering, firing, collapsing. Reduce Motion fades the actions and names in and out at their places with no stagger or neck, rings the hovered item instead of lifting and leaning it, shades the trigger on press instead of sinking it (darker in light mode, lighter in dark), and swaps the open trigger's symbol for a close mark instead of turning it. Haptics and the checkmark stay. Reduce Transparency draws every bubble as an opaque fill.
  • VoiceOver sees the trigger as a button (double tap toggles) and each item as its own button while the menu is open.
  • Items take an optional tint (Item(symbol:label:tint:action:)): tinted glass with dark ink, for an action that needs to say something. Untinted items are neutral glass with ink that follows the appearance.
  • The trigger is signal-tinted glass with the house ink by default (tint is optional; nil uses Style.trigger). All type and symbols are semibold.
  • Style: trigger, ink, labelInk, triggerSize, itemSize, scrimOpacity, confirmsAction; labelFill is kept for existing code but no longer used, since names are neutral glass. In an arc of three or more, the top item's name sits above it.
  • Before iOS 26 the same choreography runs on a frosted fallback, where shapes don't merge into a neck.
  • For a floating pill that morphs into a full toolbar and panel, see the Pro Reader screen (morph-nav).

Usage

GlassActionMenuExample()
    .preferredColorScheme(.light)

Parameters

ParameterDescription
itemsActions in emergence order (nearest to the trigger first). Give an item a tint to tint its glass.
triggerSymbolSF Symbol on the collapsed trigger. Rotates 45° while open (under Reduce Motion it swaps to a close mark instead).
arrangement.linear stacks items upward; .arc fans them from up to leading, for a bottom-trailing placement.
tintTrigger glass tint. nil uses style.trigger, the house signal red. Items keep their own tints so the trigger reads as the anchor.
isExpandedOptional binding to open or close the menu programmatically; it is written back when the user toggles it.
styleTrigger tint, inks, sizes, scrim strength and the confirmation check.

Install

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

Terminal

$npx swiftpieces add GlassActionMenu

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

>Add the SwiftPieces "Glass Action 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 liquid glass →

Build it yourself: Liquid Glass 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.

54 screens · 46 patterns · 48 flows · 12 templates · 31 Build Kit skills

Explore Pro