Micro-interactions

Tilt

A machined card that leans toward the pointer in 3D while a specular sheet slides across its face.

Install

bun add clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/tilt/tilt.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
maxTiltnumber10Maximum lean at the card's edge.
perspectivenumber900Depth of the 3D projection — lower exaggerates it.
glarenumber0.35Opacity of the specular sheet, matte → mirror.
glareSizenumber0.9Glare radius as a fraction of card width.
hoverScalenumber1.03Scale applied while the pointer is over the card.
smoothingnumber0.28How long the card takes to catch up to the pointer.
glareColorstring (hex)"#c4b5fd"Tint of the specular sheet.

What It Demonstrates

3D tilt / Flip
Rotate in 3D space (rotateX / rotateY) to add depth.
Perspective
How strong the 3D effect looks — a lower value exaggerates depth, like the viewer is closer.
Transform origin
The anchor point a scale or rotation grows or spins from.
Hover effect
Visual change when the cursor moves over an element.
Asymmetric easing
A curve that accelerates and decelerates at different rates. Feels more alive than a symmetric one.
Hardware acceleration
Animating transform and opacity lets the GPU keep motion smooth.

Related Components

Appears In