kipluo
Included in $29 packInteractionsReact + FlutterOnboardingLists & inboxesSocial

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.

Live interactive demo · Drag or fling the top card.

Ship the onboarding

Today

Review pricing page

Tomorrow

Reply to Mara

Friday

Motion preview loop

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

Colours
Shadow
<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-stack

Working code example

physics-card-stack.tsx
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 / ToolStatusDetails
React 18 & 19Full supportZero peer runtime lock-in beyond @kipluo/core.
Next.js App RouterFull supportShips with 'use client' boundaries; SSR-safe hydration.
Vite / Remix / AstroFull supportStandard ESM TypeScript source files you own.
Tailwind CSS v4 & shadcn/uiNativeInherits CSS variables and installs via shadcn registry or CLI.
Flutter (Dart)Native packageMatching spring physics, themes, and PCM audio in packages/flutter/kipluo.

Build it yourself: related tutorials

All tutorials →