Tilt Card
A card that tilts in 3D toward the pointer on hover.
Usage
Copy src/TiltCard.tsx into your React project. No extra dependencies.
tsx
import { TiltCard } from "./TiltCard";
export function Example() {
return (
<TiltCard>
<h3>Hover me</h3>
<p>Subtle perspective tilt follows the pointer.</p>
</TiltCard>
);
}Notes
- Client component (
"use client") - Uses
perspective+rotateX/rotateYfrom pointer position - Respects
prefers-reduced-motion(no tilt)