Skip to content

    Browse components

    Lens Follow

    A liquid glass lens that trails the cursor, magnifying and refracting the content beneath it with chromatic edges.

    Open
    Customize

    Installation

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

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

    Usage

    import { LensFollow } from "@/components/ui/lens-follow";
    
    <LensFollow className="h-[32rem]" size={200} zoom={1.35}>
      <YourContent />
    </LensFollow>

    Props

    PropTypeDefaultDescription
    childrenReactNode—Content the lens floats over. Give it its own background.
    sizenumber200Lens diameter in px.
    zoomnumber1.35Magnification inside the lens.
    refractionnumber60Px of edge refraction.
    aberrationnumber6Px of chromatic split at the rim.
    wobblebooleantrueSquash and stretch the lens with its speed.
    classNamestring—Extra classes for the root element.