Docs
Sheets

Confirm Sheet

A confirmation card as a bottom sheet or an inline card, its confirm and cancel splitting out of one glass shape as it lands.

$npx swiftpieces add ConfirmSheet
See it in a Pro app On a real screen in one of the Pro apps: open it with Pro, take it apart, remix it, and copy the SwiftUI.
Free · MIT + Commons ClauseiOS 17.0+Liquid Glassconfirmsheetdestructivedialoghaptic
Type
ConfirmSheet
Files
ConfirmSheet.swift
Depends on
Nothing (Apple frameworks only)
Version
2.2.0
In a full screen · SwiftPieces ProStayA stay detail screen over full-bleed scenery, with a floating booking card that rises and flicks away.

Presents a confirmation card as a bottom sheet, or inline as an overlay in the current hierarchy.

Notes

  • Sheet mode measures the card and uses .presentationDetents([.height(...)]), so the sheet is exactly as tall as the content at the current Dynamic Type size, with Style.surface as its background. The system sheet keeps its own presentation and drag physics.
  • Inline mode floats the card at the bottom of the view it is applied to, over a dimmed backdrop. Apply it near the root so the backdrop covers the screen. The solid card slides all the way in from below the screen on a calm spring that lands with a slight give, and leaves faster and firmer than it came; the backdrop fades with it.
  • Drag the inline card down and it stays under your finger while the backdrop brightens; pull it up and it gives with rubber-band resistance. A rigid impact ticks once the moment a flick would commit. Let go past the line and the card leaves at the speed of your flick; short of it, it settles home at the speed you let go, with a small give from below and a livelier one from above. Grab it again while it is settling and it stops right where it is, without a jump. A drag the system interrupts, such as an incoming call, brings the card home too.
  • The card stays solid; its two actions are liquid glass capsules that rest apart, in one glass group. The card presents with a single primary capsule, and as it lands the cancel capsule buds down out of it, pulling a liquid neck that thins and snaps, and settles below. Cancel keeps its place in the layout while it is inside the primary, so the card and a sheet's detent never change height.
  • confirm is async. Tapping the primary melts cancel back up into it, and the primary disables while a spinner sharpens in and its label morphs letter by letter to Working. When confirm returns the spinner gives way to a check, the label morphs to Done and the glass turns sage, with a .success haptic. The tile follows a beat later into a sage check with a small pop, and the card leaves about half a second after that, still showing its outcome. Working and Done go through String(localized:).
  • Destructive cards use a signal tile and signal-tinted glass for the primary, and play .warning as the card lands, or on the tap if you confirm before it does. Other cards use a sky tile and glass tinted with the label color. The tile symbol bounces as the card lands on every presentation. Both capsules sink slightly while pressed. All text is semibold.
  • Style sets every color and the card radius (34pt by default). quiet colors only the grabber now; the cancel capsule is neutral glass.
  • On iOS 26 the capsules are Liquid Glass and melt into each other through the neck; before that they are frosted glass with a light rim, and with Reduce Transparency they are solid.
  • Under Reduce Motion the card and backdrop crossfade instead of sliding, a drag that falls short settles without overshoot, cancel fades in and out in place instead of budding, the labels crossfade instead of morphing, the capsules dim instead of sinking while pressed, the tile neither bounces nor pops (its color and symbol still change, by crossfade), and the success beat is shorter. The haptics are unchanged.
  • At accessibility text sizes the labels are plain text that can wrap, and change with a blur instead of the letter morph.
  • For a floating booking card with detents, see the Stay screen (glass sheet) in SwiftPieces Pro.

Usage

ConfirmSheetExample()

Parameters

ParameterDescription
isPresentedShows the card while true. Confirming, cancelling, and dragging away set it back to false.
inlinetrue overlays the card in place with a dimmed backdrop and a rubber-banded drag to dismiss; false uses .sheet sized to the card.
systemImageSF Symbol in the icon tile.
titleHeadline.
messageSupporting copy under the title.
confirmTitlePrimary button title.
cancelTitleSecondary button title, on a neutral glass capsule that buds out of the primary as the card lands.
isDestructiveUses the destructive tile and the signal-tinted primary button, and plays a .warning haptic on present.
styleColors and corner radius. Defaults to the SwiftPieces house palette, adapting to light and dark.
confirmAsync handler for the primary button. Cancel melts back into the button, which spins and reads Working until it returns, then turns sage with a check and Done that the tile answers a beat later, then the card dismisses.

Install

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

Terminal

$npx swiftpieces add ConfirmSheet

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

>Add the SwiftPieces "Confirm Sheet" 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 sheets →

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

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

Explore Pro