TiltCard

3D tilt that follows the pointer, with a gloss sliding the other way. Cards.

Open playground
Tilts toward your cursor.

About

TiltCard is a React component in the Cards category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { TiltCard } from "@ashutoshswamy/smoui" and set max, className.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { TiltCard } from "@ashutoshswamy/smoui";

<TiltCard className="rounded-2xl bg-neutral-100 p-8">Tilts toward your cursor.</TiltCard>

Props 2

max

Max rotation in degrees.

numberdefault 10
className

Class on the card.

string