Browse components
Lean Card
A card that leans and drifts toward the pointer while its shadow slides away and the content counter-leans for depth.
Installation
npx shadcn@latest add @glint-ui/lean-cardFirst time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glint-ui-seven.vercel.app/r/lean-card.json
Usage
import { LeanCard } from "@/components/ui/lean-card";
<LeanCard className="w-64">
<img src="/cover.jpg" alt="" />
<h3>Title</h3>
</LeanCard>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Card content. |
| lean | number | 7 | Max lean in degrees. |
| drift | number | 10 | Px the card drifts toward the pointer. |
| counter | number | 0.6 | How much the content leans back. |
| shadowShift | number | 22 | Px the shadow slides away from the pointer. |
| stiffness | number | 9 | Follow speed. |
| glare | boolean | true | Soft light that follows the pointer. |
| className | string | — | Extra classes for the root element. |