Loading component…
Loading component…
A card that tilts in 3D towards the pointer, with a soft glare and a spring back
To reuse this local React demo, copy all files from the Code tab into the same folder, then import TiltCard from ./tilt-card.
import { TiltCard } from "@/components/ui/tilt-card";
export function MembershipCard() {
return (
<TiltCard maxTilt={10} scale={1.02}>
<div className="membership">
<span>TavrixUI Pro</span>
<span>•••• 4821</span>
</div>
</TiltCard>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | The card's content – it fills the tilting surface | |
| maxTilt | number | 10 | Maximum tilt in degrees |
| glare | boolean | true | Show a soft glare that follows the pointer |
| scale | number | 1.02 | Scale while the pointer is over the card |
| perspective | number | 900 | Perspective distance in px – smaller is more dramatic |
| className | string | Extra class on the wrapper; set --ui-tc-radius to match your card's corners |
Sizes to its content; the demo card shrinks to the available width
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"