React Physics Card Stack – Draggable Spring Card Deck
Interactive draggable card stack for React with grip-aware torque, behind-card spring lift, velocity fling projection, keyboard arrows, and sound.
Ship the onboarding
Today
Review pricing page
Tomorrow
Reply to Mara
Friday
Ship the onboarding
Today
Review pricing page
Tomorrow
Reply to Mara
Friday
Live vector preview rendered straight from the same 120 Hz spring engine—no heavy GIF compression artifacts, zero layout shift.
Customization playground
Tune outline, fill, accent, text colour, and shadow direction live above. The snippet updates automatically for copy-and-paste.
Customize
<PhysicsCardStack />Installation
Install directly into your project source with the Kipluo CLI (React/Tailwind v4) or add the matching Flutter package.
Install
$ npx kipluo add physics-card-stackWorking code example
import { PhysicsCardStack } from "@/components/kipluo/physics-card-stack";
const cards = [
{ key: "1", title: "Ship the onboarding", meta: "Today" },
{ key: "2", title: "Review pricing page", meta: "Tomorrow" },
{ key: "3", title: "Reply to Mara", meta: "Friday" },
];
export function OnboardingDeck() {
return (
<PhysicsCardStack
items={cards}
loop={false}
onDismiss={(card, dir) => console.log("Dismissed", card.title, dir)}
/>
);
}What Physics Card Stack does
- Tracks exact pointer grab height so grabbing near the top tilts opposite to grabbing near the bottom, matching real physical cards.
- Continuously lifts and scales cards behind the active card proportionally to drag distance, then arcs dismissed cards smoothly behind the deck.
- Supports vertical scroll yielding on mobile touch screens, ArrowLeft/ArrowRight keyboard dismissal, controlled order/looping, and mid-flight interruption without snapping.
Accessibility & sound behavior
Keyboard & screen readers: Arrow Left / Right launch the top card along the same arc-and-tuck flight. Focus stays on the stack; throws are announced politely.
Reduced motion: Automatically respects prefers-reduced-motion: reduce by snapping spring targets immediately without jarring travel.
Sound cues: A tick on grab and when crossing the throw line, a velocity-pitched swish flying to the throw side, and a soft low boop when it tucks behind or springs back. Disable per instance with sound={false} or globally via setSoundEnabled(false).
API reference
itemsT[]- Cards to render, top first. Default
Demo cards. renderCard(item, state) => ReactNode- Custom card content; receives { depth, isTop }. Default
Built-in card. getItemKey(item, index) => string | number- Stable key per item. The stack only resets when the set of keys changes, so passing a fresh array each render is safe. Default
item.id, else index. order / defaultOrdernumber[]- Controlled or initial card order (indices into items).
onOrderChange(order: number[]) => void- Called whenever the stack order changes.
loopboolean- Tuck thrown cards behind the stack, or dismiss them until reset. Default
true. emptyStateReactNode- Content shown when loop is false and all cards are thrown. Default
Deal again. thresholdnumber- Drag distance in px that commits a throw. Default
110. velocityThresholdnumber- Fling speed in px/s that commits a throw regardless of distance. Default
600. springSpringConfig- Physics for card flight, tuck and stack settling. Default
{ stiffness: 240, damping: 22, mass: 1 }. visibleCountnumber- Number of stacked cards visible at rest. Default
3. onThrow(item, direction) => void- Called once per committed throw ("left" | "right").
compactboolean- Smaller cards, for tight layouts. Default
false. refRef<PhysicsCardStackHandle>- Imperative handle with reset() and throwTop(direction).
soundboolean- Plays this component's sounds. The global switch setSoundEnabled(false) silences every component. Default
true.
Framework compatibility
| Platform / Tool | Status | Details |
|---|---|---|
| React 18 & 19 | Full support | Zero peer runtime lock-in beyond @kipluo/core. |
| Next.js App Router | Full support | Ships with 'use client' boundaries; SSR-safe hydration. |
| Vite / Remix / Astro | Full support | Standard ESM TypeScript source files you own. |
| Tailwind CSS v4 & shadcn/ui | Native | Inherits CSS variables and installs via shadcn registry or CLI. |
| Flutter (Dart) | Native package | Matching spring physics, themes, and PCM audio in packages/flutter/kipluo. |
Build it yourself: related tutorials
All tutorials →How to Create a Draggable Card Stack with Spring Physics
Build a tactile, interruptible draggable card stack in React with grip-aware rotation, velocity fling projection, behind-card scaling, and keyboard navigation.
How to Create Interactive Dragging with Pointer Events
Master unified mouse, touch, and pen dragging in React using setPointerCapture, touch-action, velocity sampling, and clean pointercancel recovery.
How to Handle Interrupted Animations in React
Learn why rapid clicks, mid-flight drags, and unmounts break React animations—and how velocity-preserving springs and proper cleanup make them unbreakable.
Related components
- Open component →Stacking DeckPaid
Vertical interactive deck where stepping or dragging peels the front card upward while trailing cards rise with spring depth compression.
- Open component →Tilt CardFree
A card that tilts toward the pointer in 3D with a glare sliding across it, and springs flat when the pointer leaves. Off on touch and with reduced motion.
- Open component →Infinite MarqueeFree
Seamless ticker strip that decelerates cleanly on hover, accepts drag/fling momentum in either direction, and pauses under reduced motion.
- Open component →Flip 3D CardFree
Two-sided 3D extruded card with drag-to-peek 180° spinning, velocity-aware snapping, extruded edge depth, and a moving specular glare.
- Open component →Interactive CarouselPaid
Momentum card track with velocity-projected snapping, rubber-band ends, peeking neighbors and paper-flip audio.
- Open component →Pull to RefreshPaid
Rubber-band overscroll from the top edge with an audible threshold detent, async loader handoff and clean unmount abort.