A draggable card stack where each swiped card cycles to the back with smooth momentum-based animations.
One Piece
Attack on Titan
Naruto
Demon Slayer
Jujutsu Kaisen
My Hero Academia
Fullmetal Alchemist
Hunter x Hunter
$ npx shadcn@latest add https://akshitr.com/r/swipe-cards.json
import SwipeCards from "@/components/swipe-cards";
const cards = [
{ id: 1, title: "Santorini, Greece", url: "/images/santorini.jpg" },
{ id: 2, title: "Kyoto in Autumn", url: "/images/kyoto.jpg" },
];
export default function SwipeCardsDemo() {
return <SwipeCards cards={cards} />;
}| Prop | Type | Default | Description |
|---|---|---|---|
| cards | CardData[] | — | Array of card data to render in the stack. |
| className? | string | — | Additional classes applied to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| id | number | — | Unique identifier for the card. |
| url | string | — | Image URL rendered as the card background. |
| title | string | — | Label rendered at the bottom of the card. |
120px or a velocity of 500px/s — whichever is hit first.±340px in the drag direction before the stack reorders, keeping the visual stack consistent without any flashes.dragElastic={1} means the card tracks the pointer with zero resistance — it follows your finger exactly.