Skip to content

Tilt Card

A card with pointer-driven perspective and a moving reflection.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import TiltCard from "./TiltCard";
export default function Example() {
return (
<TiltCard
children={"Beyond the flat."}
maxTilt={16}
glare={0.25}
background={"radial-gradient(ellipse at 90% 5%, #dabdf67a, transparent 60%), linear-gradient(135deg, #383344, #17141e)"}
borderRadius={22}
minHeight={290}
style={{
"fontSize": "clamp(2rem, 4vw, 3.5rem)",
"fontWeight": 500,
"letterSpacing": "-.05em",
"display": "grid",
"alignItems": "end"
}}
/>
);
}

Using Tilt Card

Place your card content in children and use minHeight to reserve enough space for it. maxTilt controls the pointer-driven angle.

Use glare to tune the reflection and borderRadius to match the card's shape. Leave room around the card for the tilt.

Props

NameTypeRequiredDefaultDescription
childrenReactNodeNoundefinedCard contents. Text, media and actions are supplied by the caller.
maxTiltnumberNo12Total pointer rotation range in degrees.
glarenumberNo.22Maximum reflection opacity from 0 to 1.
backgroundstringNo"#252232"Any CSS background value.
borderRadiusnumberNo22Corner radius in pixels.
minHeightnumber | stringNo260Minimum height in pixels or a CSS length. The component can fill a taller parent.
classNamestringNo""Additional CSS classes, merged with the component styles.
styleCSSPropertiesNoundefinedInline styles for caller-defined sizing and visual overrides.

Related components

A paper flap lifts in 3D as a message slides out of its envelope.

A lightly textured receipt pairs precise item rows with a torn paper edge.

A suspended badge swings naturally after you drag and release its handle.

Fine metallic grooves catch a shifting iridescent pointer highlight.