Special/SwipeCards

SwipeCards

Tinder-style draggable card stack. Drag horizontally past the threshold to swipe — LIKE/NOPE labels appear as you drag. Cards below scale and offset to create natural depth. Release before the threshold to spring back.

import { SwipeCards } from "@animui/ui"

Demo

🚀LaunchSwipe past 100px
🌿GrowRelease to snap back
🎨CreateLIKE / NOPE on drag

Swipe log

drag a card…

Swipe behavior

  • Below threshold: Card springs back to center with a smooth bounce.
  • Past threshold: Card flies off screen, onSwipe fires immediately, card is removed 380ms later.
  • Stack empty: emptyContent is shown; onEmpty fires. Remount via key change to reset.

SwipeCard props

PropTypeDefaultDescription
idstring | numberUnique identifier used as the React key.
contentReactNodeCard contents. Use h-full w-full to fill the container.

SwipeCards props

PropTypeDefaultDescription
cardsSwipeCard[]Array of cards to display. Each needs a unique id.
onSwipe(card: SwipeCard, direction: "left" | "right") => voidFires immediately when swipe threshold is crossed.
onEmpty() => voidCalled after the last card is swiped away.
emptyContentReactNodenullShown in place of the stack when all cards are swiped.
thresholdnumber100Horizontal pixel offset required to trigger a swipe.
visibleCountnumber3Number of cards visible in the stacked view.
classNamestringSet width and height of the card container here (required).
cardClassNamestringApplied to each individual card element.
© 2026 Steal Shadow. MIT License.Report an issue