Loading preview
Animated Card
CardsA card that tilts in 3D toward the pointer with spring physics.
A two-sided card that turns over in 3D, by button or on hover.
npx shadcn@latest add @venusui/flip-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/flip-card.tsxThe code behind the preview above.
flip-card-demo.tsx
import { FlipCard } from "@/components/ui/flip-card"
export default function FlipCardDemo() {
return (
<FlipCard
flipOnHover
flipLabel="Show plan details"
front={
<div className="flex h-full flex-col justify-between">
<p className="font-mono text-xs tracking-widest text-muted-foreground uppercase">Team plan</p>
<p className="text-4xl font-semibold tracking-tight">$79<span className="text-base font-normal text-muted-foreground">/month</span></p>
<p className="text-sm text-muted-foreground">Hover, or press the button to flip.</p>
</div>
}
back={
<ul className="space-y-2 text-sm">
<li>Up to 10 members</li>
<li>Roles and permissions</li>
<li>Priority support</li>
<li>Audit log</li>
</ul>
}
/>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| front | ReactNode | — | Front face content. Required. |
| back | ReactNode | — | Back face content. Required. |
| flipLabel | string | "Flip card" | Accessible name for the flip button. |
| flipOnHover | boolean | false | Also flip while a mouse is over the card. |
| className | string | — | Classes for the outer element, e.g. a different height. |
Only the props above.
lucide-react for the flip icon, React 19 and Tailwind CSS v4.h-64 by default. Pass className="h-80" for taller content; both faces fill it.flipLabel such as "Show plan details".aria-pressed), so it works with keyboard, touch and screen readers; hover is an extra.inert and aria-hidden, so its content can’t be focused or read by mistake.backface-visibility: hidden and transform-style: preserve-3d; don’t remove those classes.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.
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.