Skip to content

    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.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/lean-card

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.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

    PropTypeDefaultDescription
    childrenReactNode—Card content.
    leannumber7Max lean in degrees.
    driftnumber10Px the card drifts toward the pointer.
    counternumber0.6How much the content leans back.
    shadowShiftnumber22Px the shadow slides away from the pointer.
    stiffnessnumber9Follow speed.
    glarebooleantrueSoft light that follows the pointer.
    classNamestring—Extra classes for the root element.