Docs
Glass

Glass Quick Add

A liquid glass Quick add pill that grows into a menu of capture kinds, then re-forms in place into the capture you pick.

By · Updated

Glass Quick Add: SwiftUI component for iOS, live preview in light mode

Glass Quick Add, a SwiftUI component for iOS 17+, in its live preview. Open Code for the Swift source.

$npx swiftpieces add GlassQuickAdd
Free · MIT + Commons ClauseiOS 17.0+Liquid Glassglassquick-addcapturemenumorphformliquidbudsound
Type
GlassQuickAdd
Files
GlassQuickAdd.swift
Depends on
Nothing (Apple frameworks only)
Version
1.1.0

A capture kind in a GlassQuickAdd: its row in the menu, and what the capture asks for.

Notes

  • It has sound built in: a ratchet as it opens and folds, a click on each kind, and a chime when it saves. They are short Detent clicks rendered from code inside this file, so there are no audio files to add. They play beside the haptics, go quiet with the ringer switch and mix under music. Turn them off with the style's sounds: false, or for every piece at once with @AppStorage("SwiftPiecesSoundsOff").
  • One glass card that changes what it is. At rest it is a Quick add pill. Tap it and it grows up and across into a card listing the capture kinds, each keyed by a tinted disc; pick one and the same glass re-forms in place into that kind's capture: a header with the kind and a close button, a title field (up to three lines) and the kind's option chips. The card's 26pt continuous corner makes the 52pt pill a capsule and the open card a rounded panel, so the shape never changes kind, only size, on the morph spring. Each stage's contents blur out as the next blur in.
  • It grows from its lower trailing corner, so place it at the bottom of its space (a screen's bottom trailing corner, above a tab bar) and it opens upward.
  • Save is a signal bubble joined under the card's trailing corner. It buds out of the card the moment the field has text and melts back into the corner if the field empties, so it is only ever there when there is something to save. Saving (or Return) calls onSave with the kind, the trimmed text and the options that are on, then plays its own beat before anything closes: Save shows a spinner and morphs letter by letter to Saving, then turns sage with a check and Saved, with a success tap, then melts home and the card folds down into the pill. Each stage's contents leave quickly and the next arrive a beat later, so they never smear together as the glass resizes.
  • The field takes focus as a capture opens, so the keyboard rises with it. Chips are plain content inside the card's glass: a soft fill, stronger when on; any number can be on.
  • Pass stage to open the menu or a capture from your code (.closed, .menu, .capture(id)), text to keep a draft or fill it in, and change saveTrigger to save from your code (a keyboard shortcut, a toolbar button) as if Save were tapped. Without them the piece keeps its own.
  • Haptics: a soft impact as the pill opens, a success tap as Saved lands.
  • On iOS 26 the card and Save are Liquid Glass and Save's neck forms against the card; before that they are frosted glass, and under Reduce Transparency they are solid.
  • Reduce Motion: the card resizes on a short spring with no overshoot, Save fades in and out where it rests instead of budding, and the stage swaps cross-fade.
  • VoiceOver: the pill, every kind, each chip (with its selected state), Close and Save are buttons; saving is announced. Text follows Dynamic Type.
  • Style (GlassQuickAddStyle) sets the label, secondary, ink, action (Save) and success (Saved) colours. Kind (GlassQuickAddKind) sets each kind's id, symbol, title, prompt, options and disc tint. All text and symbols are semibold.

Usage

GlassQuickAddExample()

Install

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

Terminal

$npx swiftpieces add GlassQuickAdd

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

>Add the SwiftPieces "Glass Quick Add" 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.

Explore Pro