Stacked Tinder-Swipe Cards

Pro

A real deck where the top card flicks off under your thumb and the one underneath physically rises in real time.

carousel
Stacked Tinder-Swipe Cards component preview

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add stacked-swipe-deck

Usage

Import StackedSwipeDeck from @/components/wensity/stacked-swipe-deck and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import {
StackedSwipeDeck,
type SwipeCardItem,
} from "@/components/wensity/stacked-swipe-deck";
const cards: SwipeCardItem[] = [
{ id: "ada", title: "Ada, 27", subtitle: "Designer · SF",
gradient: "linear-gradient(135deg, #ff8a73, #cd1c18)" },
{ id: "ren", title: "Ren, 31", subtitle: "DJ · Tokyo",
gradient: "linear-gradient(135deg, #1f2937, #0a0a0b)" },
{ id: "kai", title: "Kai, 24", subtitle: "Photographer · Berlin",
gradient: "linear-gradient(135deg, #ffa896, #cd1c18)" },
];
export default function Example() {
return (
<StackedSwipeDeck
cards={cards}
width={320}
height={440}
onSwipe={(id, dir) => console.log(id, dir)}
/>
);
}

Props

PropTypeDefaultDescription
cardsSwipeCardItem[]-Cards in the swipe deck.
visibleCountnumber3Visible cards in the stack.
widthnumber320Width of each card in pixels.
heightnumber440Height of each card in pixels.
showActionsbooleantrueShow the action button row (Pass / Super-like / Like).
betweenActionsReact.ReactNode-Optional content rendered between the card stack and action controls.
loopbooleantrueRe-cycle swiped cards back onto the bottom of the deck.
onSwipe(id: string, direction: SwipeDirection) => void-Fired after a card is swiped away.