Skip to content
Knsept
Free playbook

3D tilt card

A card that tilts toward the pointer in 3D, with its contents floating above the surface. Drag on touch; a smaller tilt with reduced motion.

CSSJavaScriptUI Widgets Updated Oct 23, 2026
Live demo Reduced motion is on, so effects are toned down
<div class="tilt-stage">
  <article class="tilt">
    <span class="tilt-tag">New</span>
    <h3>Tilt card</h3>
    <p>Move the pointer over me, or press and drag on a phone.</p>
  </article>
</div>

The rotation comes from two CSS variables, --rotate-x and --rotate-y, and the perspective on the parent turns that into depth. transform-style: preserve-3d lets the tag, title and text sit at different heights above the card (translateZ), so they slide against the surface as it tilts. That parallax is what sells the 3D.

A long transition when the pointer leaves makes the card settle back softly, while a short one during tracking keeps it responsive. The math: the pointer's position across the card runs from 0 to 1, so subtracting 0.5 and doubling gives −1 to 1, which scales to ±maxTilt degrees.

Touch: press and drag across the card; it flattens when you lift your finger. With reduced motion on, the tilt is capped at 5° instead of 14°.

More from the library

Cards & surfaces live

Spotlight card

A card with a soft glow that follows the cursor. Two CSS variables and one set of listeners.

Navigation live

Smooth accordion

A FAQ accordion built on native details/summary, with a smooth open and close animation and an optional one-open-at-a-time mode.

Scroll & motion live

Count-up stats

Numbers that count up when they scroll into view, with easing and formatting. A quicker count with reduced motion.