Skip to content

3D Tilt Card for React

A 3D tilt card for React that leans toward the pointer, up to 8°, with a glare sliding across its glass surface on springs. Use it as a tilt effect for a hero tile or a featured product card that leans toward the pointer in 3D, with a glare and a rim light sliding across the glass.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/tilt-card.json
Sheen PayPro

Card ending in 0815

Ada Lovelace, 09/29

Membership card

TiltCardLayer adds parallax: layers drift toward the pointer by their depth, so the card reads as layered without preserve-3d (which glass cannot use). A glare and a diagonal streak of light slide across the glass, and its edge catches the light nearest the pointer. Rest the pointer near a corner: the card holds still.

Sheen PayPro

Card ending in 0815

Ada Lovelace · 09/29

Files to copy

4 folders · 3 files · 3 packages
From theme/src/
  • components/tilt-card/
  • hooks/{use-media-query.ts, use-preferences.ts}
  • lib/cn.ts
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/tilt-card.jsonRegistry item: tilt-card. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/badge/
  • lib/warn-once.ts
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/badge.json
Packages
pnpm add clsx motion tailwind-merge

Pricing cards

A gentler tilt (maxTilt={5}) on cards that are links. The whole card is clickable through a stretched link, and keyboard focus shows a solid ring.

  • Starter

    $0/mo

    For side projects

  • ProPopular

    $24/mo

    For growing teams

  • Scale

    $79/mo

    For serious traffic

TiltCard props

PropTypeDefaultDescription
level2 | 1 | 32Sets the glass level: 1 = subtle, 2 = cards (default), 3 = most opaque.
tintbooleanfalseTints the surface with the accent colour.
maxTiltnumber6Largest tilt in degrees, 0 to 8 (clamped).
glarebooleantrueDraws a light that slides across the surface.
glareColorstringa white light, stronger in light modeColour of the glare (any CSS colour, keep it translucent).
hoverScalenumber1.02Scale while the pointer is on the card (1 for none).
perspectivenumber1000Distance to the "camera" in px: smaller is more dramatic.
styleCSSPropertiesNoneInline styles for the card (merged with the tilt transform, which wins).

TiltCardLayer props

PropTypeDefaultDescription
depthnumber10How far (px) the layer drifts toward the pointer at the card's edge. Negative drifts away.
styleCSSPropertiesNoneInline styles for the layer (the drift transform is added to them).

Keyboard

KeysAction
TabNot focusable: a plain card is not focusable. Interactive children keep their own tab stops, and the tilt never moves them out of reach.

Accessibility

  • A plain div that does not change reading order. The tilt is transform-only and reads the pointer, not focus.
  • It is off for touch (a finger on a card is scrolling) and under reduced motion; TiltCardLayer adds decorative depth.

When to use the 3D tilt card effect

  • Use it on a hero tile, a pricing card or a product card that should feel physical under the pointer: it tilts in 3D, and the glare and rim light slide across the glass as it moves.
  • Use it for a pricing card or a profile showcase, wrapping the title in TiltCardLayer with a depth so it drifts toward the pointer and appears to float above the surface.
  • Tune the motion with maxTilt (0 to 8 degrees), hoverScale and perspective, and set glare={false} when you want the lean without the light.
  • Skip it when the card is large, dense or full of controls; a flat glow from SpotlightCard or a calm GlassCard is easier to read, and tilting a form makes it harder to aim.
  • Pair it with TiltCardLayer for parallax, Badge for a Featured tag, and Button inside the card, whose tab stops and focus ring stay put while the card tilts.

Frequently asked questions

19 effects pages in all: browse them on All effects.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .