3D Tilt Card

A 3D card that tilts toward the pointer with parallax depth and glare.

@spectrumui/tilt-card
Aurora Headphones
Studio sound with adaptive noise cancellation.
Aurora Headphones product shot
$249

Move the pointer across the card — layers lift at different depths

Installation

Login to view commandCreate a free account to access the install command

Usage

import { TiltCard, TiltCardItem } from "@/components/spectrumui/tilt-card"
<TiltCard className="max-w-sm p-6">
  <TiltCardItem depth={60}>Floats above the card</TiltCardItem>
  <TiltCardItem depth={30}>Floats a little less</TiltCardItem>
</TiltCard>

API Reference

TiltCard

The perspective container and card surface. Wrap any content; use TiltCardItem for pieces that should lift toward the viewer while hovered.

PropTypeDefaultDescription
maxTiltnumber12Maximum rotation toward the pointer in degrees
tiltReversebooleanfalseInvert the tilt so the card leans away from the pointer
scalenumber1.02Scale applied to the card while hovered
perspectivenumber1000CSS perspective distance in pixels
glarebooleantrueShow the pointer-following glare highlight
glareColorstring"rgba(255, 255, 255, 0.35)"Color at the center of the glare gradient
containerClassNamestring-Classes for the outer perspective wrapper
classNamestring-Additional classes merged with the card surface styles

TiltCardItem

A depth layer inside the card. While the card is hovered it translates on the Z axis by depth pixels, creating the parallax pop-out effect.

PropTypeDefaultDescription
depthnumber0Lift toward the viewer in pixels while the card is hovered
classNamestring-Additional classes for the layer element

Examples

Custom Tilt and Glare

Aggressive tilt
maxTilt 20° with a sky glare
Subtle tilt
maxTilt 8° with no glare