Tilt Card
A card that tilts in 3D toward the cursor on a spring, with a soft light glare.
motionutils@soultel/use-reduced-motion-safe
Tilt me
Follows your cursor in 3D
Installation
$ pnpm dlx shadcn@latest add @soultel/tilt-cardNo namespace set up? npx shadcn@latest add https://asafefe.dev/r/tilt-card.json works too.
Manual installation
- 1. Install the dependencies.
terminal1 lines npm install motion - 2. Copy the source from the Code tab into components/tilt-card.tsx.
Usage
import { TiltCard } from "@/components/tilt-card"
export function Example() {
return (
<TiltCard className="w-64 p-6">
<p>Hover to tilt</p>
</TiltCard>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| intensity | number | 10 | Max tilt in degrees. |
| glare | boolean | true | Show the moving highlight. |
