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 controlsButtons and dials with press depth, hold, drag and outcome states.5
- Inputs and formsTracks, steppers, rails and fields built for the thumb.9
- AnimationsSprings, gesture physics, transitions and morphs, across every category.16
- 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
- CardsCards with depth, motion, parallax and gesture-driven stacks.4
- ListsRows and carousels with swipe, depth and completion physics.5
- NavigationFloating docks, tracking tabs and stretchy headers.3
- SheetsToasts, confirmations and permission moments.3
- FeedbackReactions, ratings, status morphs, skeletons and outcomes.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
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.