Tilt Card

3D Hover Card Effect for React

A card that leans toward the pointer and catches the light with a soft moving glare.

  • Card
  • Interaction
  • 3D

Uses clsx, tailwind-merge

Open in ChatGPTOpen in Claude
maxTilt12°
scale1.03×
perspective900px
glaretrue
duration0.20s
<TiltCard />

The demo follows as you drag.

Take this demo to your coding agent.
Add this moment from KeyframeUI to our project and adapt it to our content.

Tilt Card: A card that leans toward the pointer and catches the light with a soft moving glare.

1. Install it:
   npx shadcn@latest add @keyframeui/tilt-card-demo
   (If the CLI can't find @keyframeui, use https://keyframeui.com/r/tilt-card-demo.json instead.)
   It adds the demo, components/tilt-card-demo.tsx, and the component, components/ui/tilt-card.tsx.

2. Make it ours: our copy, data, images and colors. Keep the structure the motion depends on. If we only need the effect, use <TiltCard> on its own.

3. These props set its feel. Change them before you change the file:
   - maxTilt (default 12): Maximum rotation in degrees when the pointer is at an edge.
   - scale (default 1.03): Scale applied while the pointer is over the card.
   - perspective (default 900): CSS perspective distance in pixels. Lower values feel more dramatic.
   - glare (default true): Show a light sheen that follows the pointer.
   - duration (default 0.2): How long the card takes to follow the pointer and settle back when it leaves, in seconds. The glare fades on the same timing.

4. Don't change, in components/ui/tilt-card.tsx:
   - Pointer moves write CSS variables and never re-render the card.
   - Only the card's transform and the glare's opacity animate, each through one CSS transition on the same duration.
   - Leaving resets the tilt, scale and glare together, so the card always settles flat.
   - Under reduced motion the card doesn't tilt and the glare stays centered; the hover scale and the glare's fade remain.
   Its timing is all in the TIMING block at the top of that file.

Docs: https://keyframeui.com/components/tilt-card.md

Installation

Add the component on its own with the CLI, or copy the file in by hand.

The CLI writes components/ui/tilt-card.tsx and installs clsx and tailwind-merge. It needs the @keyframeui registry in components.json; add it once per project.

npx shadcn@latest add @keyframeui/tilt-card

Examples

Finished sections built with Tilt Card. Each one installs whole, with the component included.

Pricing Cards

Three plan cards, with the featured plan leaning harder.

Take this demo to your coding agent.
Add this moment from KeyframeUI to our project and adapt it to our content.

Tilt Card: A card that leans toward the pointer and catches the light with a soft moving glare.
This demo, Pricing Cards: Three plan cards, with the featured plan leaning harder.

1. Install it:
   npx shadcn@latest add @keyframeui/tilt-card-pricing-demo
   (If the CLI can't find @keyframeui, use https://keyframeui.com/r/tilt-card-pricing-demo.json instead.)
   It adds the demo, components/tilt-card-pricing-demo.tsx, and the component, components/ui/tilt-card.tsx.

2. Make it ours: our copy, data, images and colors. Keep the structure the motion depends on. If we only need the effect, use <TiltCard> on its own.

3. These props set its feel. Change them before you change the file:
   - maxTilt (default 12): Maximum rotation in degrees when the pointer is at an edge.
   - scale (default 1.03): Scale applied while the pointer is over the card.
   - perspective (default 900): CSS perspective distance in pixels. Lower values feel more dramatic.
   - glare (default true): Show a light sheen that follows the pointer.
   - duration (default 0.2): How long the card takes to follow the pointer and settle back when it leaves, in seconds. The glare fades on the same timing.

4. Don't change, in components/ui/tilt-card.tsx:
   - Pointer moves write CSS variables and never re-render the card.
   - Only the card's transform and the glare's opacity animate, each through one CSS transition on the same duration.
   - Leaving resets the tilt, scale and glare together, so the card always settles flat.
   - Under reduced motion the card doesn't tilt and the glare stays centered; the hover scale and the glare's fade remain.
   Its timing is all in the TIMING block at the top of that file.

Docs: https://keyframeui.com/components/tilt-card.md

Feature Grid

A grid of subtle tiles with a gentler tilt and no glare.

Take this demo to your coding agent.
Add this moment from KeyframeUI to our project and adapt it to our content.

Tilt Card: A card that leans toward the pointer and catches the light with a soft moving glare.
This demo, Feature Grid: A grid of subtle tiles with a gentler tilt and no glare.

1. Install it:
   npx shadcn@latest add @keyframeui/tilt-card-feature-grid-demo
   (If the CLI can't find @keyframeui, use https://keyframeui.com/r/tilt-card-feature-grid-demo.json instead.)
   It adds the demo, components/tilt-card-feature-grid-demo.tsx, and the component, components/ui/tilt-card.tsx.

2. Make it ours: our copy, data, images and colors. Keep the structure the motion depends on. If we only need the effect, use <TiltCard> on its own.

3. These props set its feel. Change them before you change the file:
   - maxTilt (default 12): Maximum rotation in degrees when the pointer is at an edge.
   - scale (default 1.03): Scale applied while the pointer is over the card.
   - perspective (default 900): CSS perspective distance in pixels. Lower values feel more dramatic.
   - glare (default true): Show a light sheen that follows the pointer.
   - duration (default 0.2): How long the card takes to follow the pointer and settle back when it leaves, in seconds. The glare fades on the same timing.

4. Don't change, in components/ui/tilt-card.tsx:
   - Pointer moves write CSS variables and never re-render the card.
   - Only the card's transform and the glare's opacity animate, each through one CSS transition on the same duration.
   - Leaving resets the tilt, scale and glare together, so the card always settles flat.
   - Under reduced motion the card doesn't tilt and the glare stays centered; the hover scale and the glare's fade remain.
   Its timing is all in the TIMING block at the top of that file.

Docs: https://keyframeui.com/components/tilt-card.md

Props

children

TypeReact.ReactNode

Content rendered inside the card.

className

Typestring

Extra classes for the card container.

maxTilt

TypenumberDefault12

Maximum rotation in degrees when the pointer is at an edge.

scale

TypenumberDefault1.03

Scale applied while the pointer is over the card.

perspective

TypenumberDefault900

CSS perspective distance in pixels. Lower values feel more dramatic.

glare

TypebooleanDefaulttrue

Show a light sheen that follows the pointer.

duration

TypenumberDefault0.2

How long the card takes to follow the pointer and settle back when it leaves, in seconds. The glare fades on the same timing.