Loading preview
Card Stack
CardsStacked cards with the next ones peeking out; Next sends the top card to the back.
A card that tilts in 3D toward the pointer with spring physics.
npx shadcn@latest add @venusui/animated-cardRun 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/animated-card.tsxThe code behind the preview above.
animated-card-demo.tsx
import { AnimatedCard } from "@/components/ui/animated-card"
export default function AnimatedCardDemo() {
return (
<AnimatedCard className="w-full max-w-sm p-6">
<p className="font-mono text-xs uppercase tracking-widest text-muted-foreground">Pro plan</p>
<p className="mt-3 text-3xl font-semibold tracking-tight">
$24<span className="text-base font-normal text-muted-foreground">/month</span>
</p>
<p className="mt-2 text-sm text-muted-foreground">Hover with a mouse to tilt the card.</p>
</AnimatedCard>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| maxTilt | number | 8 | Maximum tilt on each axis, in degrees. |
| hoverScale | number | 1.02 | Scale while hovered. Set to 1 to turn scaling off. |
All motion.div props (HTMLMotionProps<"div">), including className, style, initial, animate and event handlers.
motion package. The CLI installs it for you.cn helper at @/lib/utils.maxTilt, e.g. maxTilt={4}.SPRING constant at the top of the file (stiffness, damping, mass). The code lives in your project, so edit it directly.onPointerMove and onPointerLeave handlers still run. The card calls them before updating the tilt.Module not found: Can't resolve 'motion/react'.npm install motion. The CLI does this automatically; a manual install needs it.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.Stacked cards with the next ones peeking out; Next sends the top card to the back.
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.