SwiftUI sheets and toasts
The moments that ask or tell: a confirmation sheet, a pre-permission sheet, a toast with an undo action and a timer that pauses while touched, and a spotlight tour for first-run tips.
About these pieces
One self-contained Swift file each, Apple frameworks only, from iOS 17.
Confirm Sheet presents as a height-fitted bottom sheet or as an inline card you can drag away, with a loading primary action that lands on a success check before dismissing and a warning haptic for destructive choices. Permission Sheet explains a permission before the system prompt, spins while the system asks, and routes the button to Settings if the answer is no.
Toast is a single toast card with a kind tile, an optional detail line, an Undo-style action and a thin timer that pauses while touched, placed inside the safe area so it clears the Dynamic Island and rides above the keyboard.
Spotlight Tour introduces a screen one control at a time: it dims everything else through a cutout that springs from stop to stop with a red ring, places a callout with step progress above or below the target, lets taps through to the real control, and can show itself only once.
Learn the technique: SwiftUI haptics guide.
Questions
How the pieces work, and how to build the same thing yourself. Every piece's page has its full notes.
How do I show a toast in SwiftUI?
SwiftUI has no toast API. Overlay a view at the top or bottom of your root view, drive it from state, and dismiss it on a timer that pauses while touched. Toast does this with an action button and haptics.
How do I build an onboarding coach mark tour in SwiftUI?
Mark each control you want to point at, collect their frames at the screen's root, and draw a dimmed overlay with a cutout around the current one and a callout beside it. Spotlight Tour does this with .spotlightAnchor and .spotlightTour, including VoiceOver focus, Reduce Motion and a show-once option.
How do I make a bottom sheet that fits its content in SwiftUI?
Measure the content height and pass it to presentationDetents([.height(h)]). Confirm Sheet does the measurement for you.
Keep browsing
Nearby collections, then every category in the library.
- Feedback5Reactions, ratings, status morphs, skeletons and outcomes.
- Buttons and controls7Buttons and dials with press depth, hold, drag and outcome states.
- Navigation7Floating docks, tracking tabs, stretchy headers and an A to Z index.
- Text4Type that reveals, expands, holds pictures and renders as glass.
- Backgrounds2Quiet atmospheres: a Metal silk shader and a touch-reactive dot grid.
- Liquid Glass5Correct iOS 26 Liquid Glass with Material fallbacks.
- Inputs and forms17Tracks, steppers, rails and fields built for the thumb, down to addresses, map pins and signatures.
- Cards5Cards with depth, motion, parallax and gesture-driven stacks.
- Lists7Rows, grids and carousels with swipe, drag-to-select, follow-the-latest and completion physics.
- Motion1Gesture modifiers with real physics.
- Data and charts6Scrubbable charts, rings, streak heatmaps, live stats and odometers.
- AI6Streaming replies, thinking states, prompt chips and answer sources.
- Media8Photo viewing and cropping, story playback, attachments and link previews.
- Animations16Springs, gesture physics, transitions and morphs, across every category.
- Haptics33Pieces that tick, tap and confirm at the moment that matters.
Ready to build something better?
85 pieces, one file each, yours to keep. Start with the library or see what the whole app looks like.