Skip to content

    Browse components

    Follow Cursor

    A pill label that trails the cursor across a card on a spring, leans into motion and squishes on click.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/follow-cursor

    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/follow-cursor.json

    Usage

    import { FollowCursor } from "@/components/ui/follow-cursor";
    
    <FollowCursor label="View project" className="rounded-3xl">
      <img src="/cover.jpg" alt="" />
    </FollowCursor>

    Props

    PropTypeDefaultDescription
    childrenReactNode—The area the label follows the cursor over.
    labelstring"View project"Text on the pill.
    stiffnessnumber0.12Spring pull toward the cursor.
    dampingnumber0.7Velocity kept per frame. Higher is bouncier.
    tiltbooleantrueLean the pill into horizontal motion.
    hideCursorbooleantrueHide the system cursor over the area (mouse only).
    classNamestring—Extra classes for the root element.