SwiftUI components with haptic feedback
Every piece here fires haptics at the moment that matters: a threshold crossed, a detent reached, an action confirmed or refused.
About these pieces
One self-contained Swift file each, Apple frameworks only, from iOS 17.
Haptics make a control feel physical, but only when they are sparing and exact. These pieces use sensoryFeedback (iOS 17) to mark real events: a selection tick as a slider steps, a heavier detent every five seconds on Timer Dial, rising taps as Hold to Confirm passes its milestones, and a solid impact when Swipe Deck throws a card.
Each piece's notes say which feedback fires when, so you can keep the pattern consistent across your own screens.
Learn the technique: SwiftUI haptics guide, SwiftUI buttons 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 add haptic feedback in SwiftUI?
On iOS 17 and later, attach .sensoryFeedback(.selection, trigger: value) to a view; the feedback plays whenever the trigger value changes. For earlier versions, use UIImpactFeedbackGenerator or UISelectionFeedbackGenerator.
Which haptic should I use?
Selection for stepping through values, impact for physical events like a snap or a throw, success, warning and error for outcomes. Keep them rare enough that each one means something.
Keep browsing
Nearby collections, then every category in the library.
- Buttons and controls7Buttons and dials with press depth, hold, drag and outcome states.
- Inputs and forms17Tracks, steppers, rails and fields built for the thumb, down to addresses, map pins and signatures.
- Animations16Springs, gesture physics, transitions and morphs, across every category.
- 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.
- Cards5Cards with depth, motion, parallax and gesture-driven stacks.
- Lists7Rows, grids and carousels with swipe, drag-to-select, follow-the-latest and completion physics.
- Navigation7Floating docks, tracking tabs, stretchy headers and an A to Z index.
- Sheets5Toasts, confirmations, permission moments and guided tours.
- Feedback5Reactions, ratings, status morphs, skeletons and outcomes.
- 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.
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.