Skip to content

    Browse components

    Photo Fan

    A fanned stack of photo cards that bounce into place when scrolled into view and spread apart on hover.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/photo-fan

    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/photo-fan.json

    Usage

    import { PhotoFan } from "@/components/ui/photo-fan";
    
    <PhotoFan images={["/1.jpg", "/2.jpg", "/3.jpg", "/4.jpg", "/5.jpg"]} />

    Props

    PropTypeDefaultDescription
    imagesReactNode—Array of image URLs.
    cardSizenumber170Card width in px (height is 1.25x).
    overlapnumber110Px between card centers.
    rotationnumber7Fan rotation per card in degrees.
    spreadnumber70Px neighbours are pushed on hover.
    staggernumber0.08Seconds between card entrances.
    bouncinessnumber9Entrance spring damping (lower = bouncier).
    classNamestring—Extra classes for the root element.