Skip to content

Open Tilt Card with its live demo →

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>
  );
}

Props

PropTypeDefaultWhat it does
maxTiltnumber10Largest tilt in degrees at the card edge
perspectivenumber900Perspective distance in pixels; lower looks deeper
classNamestringExtra class on the card

Notes

  • Client component ("use client")
  • Uses perspective + rotateX / rotateY from pointer position
  • Respects prefers-reduced-motion (no tilt)