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.

Next

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.