An interactive 3D card stack carousel with fan-out animation, drag gestures, and auto-advance support.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
npm packages it adds
- motion
- lucide-react
Code
"use client";
import { CardStack, CardStackItem } from "@/registry/ruixenui/card-stack";
const items: CardStackItem[] = [
{
id: 1,
title: "Luxury Performance",
description: "Experience the thrill of precision engineering",
imageSrc: "/card-slides/card-slide-01.jpg",
href: "#",
},
{
id: 2,
title: "Elegant Design",
description: "Where beauty meets functionality",
imageSrc: "/card-slides/card-slide-02.jpg",
href: "#",
},
{
id: 3,
title: "Power & Speed",
description: "Unleash the true potential of the road",
imageSrc: "/card-slides/card-slide-03.jpg",
href: "#",
},
{
id: 4,
title: "Timeless Craftsmanship",
description: "Built with passion, driven by excellence",
imageSrc: "/card-slides/card-slide-04.jpg",
href: "#",
},
{
id: 5,
title: "Future of Mobility",
description: "Innovation that moves you forward",
imageSrc: "/card-slides/card-slide-05.jpg",
href: "#",
},
];
export default function CardStackDemoPage() {
return (
<div className="w-full">
<div className="mx-auto w-full max-w-5xl p-8">
<CardStack
items={items}
initialIndex={0}
autoAdvance
intervalMs={2000}
pauseOnHover
showDots
/>
</div>
</div>
);
}
































