Loading preview
Animated Card
CardsA card that tilts in 3D toward the pointer with spring physics.
Stacked cards with the next ones peeking out; Next sends the top card to the back.
npx shadcn@latest add @venusui/card-stackRun this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/card-stack.tsxThe code behind the preview above.
card-stack-demo.tsx
import { CardStack } from "@/components/ui/card-stack"
const notes = ["Ship the beta", "Write the changelog", "Plan the launch", "Collect feedback"]
export default function CardStackDemo() {
return (
<CardStack
label="Tasks"
items={notes.map((note, i) => ({
id: note,
label: note,
content: (
<div className="flex h-full flex-col justify-between">
<span className="font-mono text-xs text-muted-foreground">Task {i + 1}</span>
<span className="text-xl font-semibold tracking-tight">{note}</span>
</div>
),
}))}
/>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| items | { id: string; label: string; content: ReactNode }[] | — | Cards. label is announced when a card reaches the top. Required. |
| label | string | "Card stack" | Accessible name for the stack. |
Only the props above, plus className.
motion and lucide-react. The CLI installs both.VISIBLE in the file for a deeper stack.inert. The top card’s label is announced.h-48; increase it (and the wrapper h-56) for more content.Unknown registry "@venusui"npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.No components.json foundnpx shadcn@latest init in your project first.A card that tilts in 3D toward the pointer with spring physics.
A sealed envelope that opens on hover or click: the flap folds back and the letter slides out.
A two-sided card that turns over in 3D, by button or on hover.