Skip to content
IndexRequest a UIAboutContact

Tilt Card

A card that tilts toward the pointer in 3D and returns smoothly when the pointer leaves.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Create a 260x160px card with a title "Aurora" and a one-line description. Add a pointer-tracking tilt: on pointermove inside the card compute the pointer position relative to the card centre, map it to rotateX and rotateY of at most 8 degrees (rotateY follows horizontal position, rotateX inverse of vertical), and apply it with perspective(800px) via a CSS custom property so updates are batched with requestAnimationFrame. Add a radial-gradient highlight overlay that follows the pointer using custom properties for x and y at 10% white opacity. On pointerleave animate back to rotate(0) over 450ms cubic-bezier(.2,.7,.2,1). Only apply the effect for pointer type mouse or pen. Disable everything under prefers-reduced-motion. Keep a 2px focus-visible ring and do not tilt on focus.

About this pattern

Definition

A card that rotates on its X and Y axes according to where the pointer is inside it, with a soft highlight following the pointer. When the pointer leaves, it eases back to flat.

Purpose & UX principles

  • Adds depth and a sense of physical material to featured items.
  • Strictly decorative: all information stays readable and the card works without the effect.
  • The tilt is small (up to 8 degrees) so text never becomes hard to read.

Interaction states

  • Rest (flat), hover (tracking the pointer), leave (eases back), focus-visible ring (no tilt on keyboard focus).

Motion specification

  • While the pointer moves the transform updates every animation frame with a 90ms transition for smoothing.
  • Return to flat: 450ms cubic-bezier(.2,.7,.2,1).
  • Reduced motion: the tilt and highlight are disabled completely.

Responsive behaviour

  • The effect is pointer-only and is disabled on touch devices.
  • The card scales with its container.

Code

HTML
<div class="stage2"><article class="tc" id="tc" tabindex="0"><div class="shine"></div><h3>Aurora</h3><p>Move the pointer across the card.</p></article></div>

Related patterns

Flip Card

↗
Flip CardCards & Containers

Hover Reveal Card

↗
Hover Reveal CardCards & Containers

Magnetic Button

↗
Magnetic ButtonButtons & Actions