Morphing Card Stack
An interactive collection of cards that smoothly layout-morphs between Stack, Grid, and List configurations using Framer Motion springs.
npx uniqueui add morphing-card-stack
Preview
Usage
import { MorphingCardStack } from "@/components/ui/morphing-card-stack";
import { Layers, Palette, Clock, Sparkles } from "lucide-react";
export default function Example() {
return (
<div className="flex items-center justify-center p-12 min-h-[500px] w-full bg-neutral-950 rounded-xl border border-neutral-800">
<MorphingCardStack
cards={[
{
id: "1",
title: "Magnetic Dock",
description: "Cursor-responsive scaling with smooth spring animations",
icon: <Layers className="h-5 w-5" />,
},
{
id: "2",
title: "Gradient Mesh",
description: "Dynamic animated gradient backgrounds that follow your cursor",
icon: <Palette className="h-5 w-5" />,
},
{
id: "3",
title: "Pulse Timeline",
description: "Interactive timeline with animated pulse nodes",
icon: <Clock className="h-5 w-5" />,
},
{
id: "4",
title: "Command Palette",
description: "Radial command menu with keyboard navigation",
icon: <Sparkles className="h-5 w-5" />,
},
]}
/>
</div>
);
}Props
| Prop | Type | Description |
|---|---|---|
cards | CardData[] | Array of CardData containing id, title, description, icon, and optional color. |
defaultLayout | "stack" | "grid" | "list" | Initial layout mode configuration. |
onCardClick | (card: CardData) => void | Callback function triggered when clicking a card. |