Glass Action Menu
A floating signal trigger that long-presses open into a staggered line or arc of color-block actions you can slide across and release to fire; the trigger confirms with a check, tap toggles, a scrim dismisses, and the glass morphs on iOS 26.
- Type
- GlassActionMenu
- Files
- GlassActionMenu.swift
- Depends on
- Nothing (Apple frameworks only)
- Version
- 2.0.0
Reader
A long-read article with a serif headline and a floating pill that morphs into a reading toolbar.
Floating action menu with a hold-slide-release gesture, staggered emergence, a dimming scrim and a confirming trigger.
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. - Items emerge one at a time (45ms stagger, reversed on collapse) and labels fade in only after the last item has landed. On iOS 26 each item carries a
glassEffectIDinside aGlassEffectContainer, so the glass blends with the trigger as it travels; earlier the same choreography runs on.regularMaterial. - The scrim is an oversized background behind the trigger; it dims everything beneath the menu in its parent and dismisses on tap. Place the menu last in a
ZStackso nothing sits above it. - Phases:
collapsed,expanding,open,hovering,firing,collapsing. Reduce Motion drops the stagger and the lift and crossfades instead; Reduce Transparency swaps glass and Material for opaque fills. - 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:)) and render as solid color blocks with dark ink; on iOS 26 clear glass sits on top for the edge and the morph. Untinted items stay glass. - The trigger defaults to the house signal color with dark ink (
tintis now optional;nilusesStyle.trigger). After an action fires it shows a checkmark for 0.9s (Style.confirmsAction). Style:trigger,ink,labelFill,labelInk(solid label capsules),triggerSize,itemSize,scrimOpacity,confirmsAction. In an arc of three or more, the top item's label sits above it.- For a floating pill that morphs into a full toolbar and panel, see the Pro Reader screen (
morph-nav).
Usage
GlassActionMenuExample()
.preferredColorScheme(.light)Parameters
| Parameter | Description |
|---|---|
items | Actions in emergence order (nearest to the trigger first). Give an item a tint to draw it as a color block. |
triggerSymbol | SF Symbol on the collapsed trigger. Rotates 45° while open. |
arrangement | .linear stacks items upward; .arc fans them from up to leading, for a bottom-trailing placement. |
tint | Trigger fill. nil uses style.trigger, the house signal color. Items keep their own tints so the trigger reads as the anchor. |
isExpanded | Optional binding to open or close the menu programmatically; it is written back when the user toggles it. |
style | Trigger and label colors, sizes, scrim strength and the confirmation check. |
Source
Install
Pick one. Run it from the folder that contains your .xcodeproj and the files land inside your app.
Terminal
Or ask your coding agent · Claude Code, Cursor or Xcode, once the MCP server is connected
Or copy the source above into your app.
Building a whole app? See Swift Pieces Pro →
Touch Grid
A Canvas dot grid that swells and warms into a house block color under the finger, springs back on release, and sends one dissipating ripple out from a tap.
Glass Segments
A segmented control whose glass indicator you can grab and drag: it lifts under the finger, rubber-bands past the ends, stretches with velocity and settles with a spring, while the label ink flips exactly under its edge; tap still works.