A card that tilts in 3D toward the pointer.

Dark Grey
Matt Mug
$20
Installation
Usage
import { Tilt, TiltContent } from '@animate-ui/react/primitives/effects/tilt';
export function ProductCard() {
return (
<Tilt maxTilt={10}>
<TiltContent className="rounded-2xl border p-4">
<img src="/mug.webp" alt="Mug" />
<h3>Matt Mug</h3>
</TiltContent>
</Tilt>
);
}Tilt tracks the pointer and sets the perspective; TiltContent is the part that rotates.
Animation
- The content rotates up to
maxTiltdegrees toward the pointer on a spring, and flattens back when it leaves. - The rotation is driven by motion values: moving the pointer never re-renders React.
- Under reduced motion, the content stays flat.
API Reference
Tilt
| Prop | Type | Default |
|---|---|---|
asChild? | boolean | false |
maxTilt? | number | 10 |
perspective? | number | 800 |
transition? | SpringOptions | { stiffness: 300, damping: 25, mass: 0.5 } |
...props? | HTMLMotionProps<'div'> | - |
TiltContent
| Prop | Type | Default |
|---|---|---|
asChild? | boolean | false |
...props? | HTMLMotionProps<'div'> | - |