3D tilt card that rotates toward the cursor on spring physics, with an optional glare reflection. React component.
Made by AxylTiltCard maps the cursor position inside the card to rotation angles: the offset from the card's center is normalized to [-0.5, 0.5] and multiplied by rotationFactor degrees, then smoothed through a spring so the card chases the cursor with inertia instead of sticking to it. The wrapper provides CSS perspective, and the card preserves 3D for its children — give a child transform: translateZ(...) to make it float above the surface.
Examples
Image Card
A subtle rotationFactor with isReverse gives an image card a heavy, physical feel — the hovered corner dips down as if pressed.
Glare
Enable glare to sweep a light reflection across the card as it tilts — the highlight tracks the cursor like light bouncing off a glossy surface.
Installation
File Structure
Usage
Props
| Prop | Type | Default |
|---|---|---|
rotationFactor? | number | 15 |
perspective? | number | 1000 |
scaleOnHover? | number | 1 |
isReverse? | boolean | false |
springOptions? | SpringOptions | { stiffness: 150, damping: 20, mass: 1 } |
glare? | boolean | false |
glareMaxOpacity? | number | 0.05 |
className? | string | - |
style? | MotionStyle | - |
ref? | Ref<HTMLDivElement> | - |
When to Use
Use TiltCard for feature cards, product shots, pricing tiers, or gallery items that deserve a tactile, physical feel — it reads best on a handful of highlighted cards, not a whole grid tilting at once. Pair glare with dark or image-backed cards where the reflection has contrast, and add overflow-hidden plus a border radius on the card so the glare clips to its shape.
On touch devices mouse events don't fire, so the card simply renders static — no fallback needed.
Accessibility
The tilt is purely decorative: content stays in the normal document flow and keyboard focus is unaffected. When prefers-reduced-motion: reduce is set, the card ignores cursor movement entirely and renders static — 3D rotation is more vestibularly triggering than flat motion, so it is disabled rather than reduced. See Accessibility.
Credits
Inspired by motion-primitives.
Built by Axyl. A motion-first component registry for React.
Last updated: 7/26/2026