06.03 · 3D & Advanced

Parallax 3D Tilt

A card tilts toward your pointer, and a light slides over it. Best for cards.

Hover it

Move your pointer over the card, drag a finger across it (or Tab to it and use the arrow keys), or press Show me.

Feature card
Three-dimensional perspective
The card leans toward your pointer, and the light follows it.

Try it

Change a setting, then try it again or press Show me.

Tilt amount

How far the card leans at its edges.

3D depth

Strong looks closer and more dramatic.

A soft light follows the pointer across the card.

More optionsFewer options

Return speed

How quickly the card settles flat again.

Leans the other way, as if you pressed it.

Lifts the card slightly while it tilts.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add a 3D tilt to [the card you want to bring to life]. As the pointer moves over the card, rotate the card slightly around its horizontal and vertical axes according to where the pointer is, and give its container a 3D perspective so the tilt has depth. When the settings include it, move a soft light across the card with the pointer, as if it catches the light. On touch screens, dragging a finger across the card should tilt it the same way. When the pointer leaves, let the card settle back flat. If the visitor has reduced motion turned on, keep the card flat. Match the settings listed below.

Replace the words in brackets with your own element. Your settings are added at the end.

Free and open source. If this helped, a star on GitHub helps other people find it.

Star on GitHub

What it is

The full explanation is in README.md.

Good for

  • Feature cards
  • Pricing cards
  • Portfolio tiles
  • Game cards

Avoid on

  • Text-heavy cards
  • Dense grids