SwiftUI cards
Cards with depth and gesture physics: a swipeable card stack, a 3D flip card, a card that tilts with the device, and a parallax image card.
About these pieces
One self-contained Swift file each, Apple frameworks only, from iOS 17.
Swipe Deck is a gesture-driven card stack: the top card follows the finger and swings from its base, an outcome badge fades in for the direction you are heading, and a flick throws it left, right or up while the cards beneath rise. Flip Card turns by tap or by a sideways drag that scrubs the rotation, lifting toward you mid-turn.
Motion Card tilts with the device's attitude through Core Motion, with a sheen and shadow that slide as it turns, and stops listening whenever the scene is not active. Parallax Card lets its image drift slower than the scroll while its caption block drifts slower still, so the card reads in layers.
Learn the technique: SwiftUI cards guide, SwiftUI animations 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 make a swipeable card stack in SwiftUI?
Stack the cards in a ZStack, attach a DragGesture to the top one, rotate it from a bottom anchor as it moves, and decide the throw from predictedEndTranslation so a flick counts. Swipe Deck does this over any Identifiable array and adds VoiceOver swipe actions.
How do I flip a card in SwiftUI?
Rotate the container with rotation3DEffect around the y axis and swap which face is visible at 90 degrees, rotating the back face 180 degrees so its content is not mirrored. Flip Card also lets a drag scrub the rotation.
Keep browsing
Nearby collections, then every category in the library.
- ListsRows and carousels with swipe, depth and completion physics.5
- AnimationsSprings, gesture physics, transitions and morphs, across every category.16
- MediaPhoto viewing and story playback.2
- 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
- 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
- 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
- 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.