SwiftUI sheets and toasts
The moments that ask or tell: a confirmation sheet, a pre-permission sheet, and a toast with an undo action and a timer that pauses while touched.
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.
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 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.
- FeedbackReactions, ratings, status morphs, skeletons and outcomes.5
- Buttons and controlsButtons and dials with press depth, hold, drag and outcome states.5
- NavigationFloating docks, tracking tabs and stretchy headers.3
- TextType that reveals, expands and renders as glass.3
- BackgroundsQuiet atmospheres: a Metal silk shader and a touch-reactive dot grid.2
- Liquid GlassCorrect iOS 26 Liquid Glass with Material fallbacks.3
- Inputs and formsTracks, steppers, rails and fields built for the thumb.9
- CardsCards with depth, motion, parallax and gesture-driven stacks.4
- ListsRows and carousels with swipe, depth and completion physics.5
- MotionGesture modifiers with real physics.1
- Data and chartsScrubbable charts, rings, live stats and odometers.4
- AIStreaming replies, thinking states, prompt chips and code.6
- MediaPhoto viewing and story playback.2
- AnimationsSprings, gesture physics, transitions and morphs, across every category.16
- HapticsPieces that tick, tap and confirm at the moment that matters.19
Ready to build something better?
55 pieces, one file each, yours to keep. Start with the library or see what the whole app looks like.