Skip to content

    Browse components

    Mosaic Flip

    A card that dissolves into a random pixel grid on hover and reassembles as its second face.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/mosaic-flip

    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/mosaic-flip.json

    Usage

    import { MosaicFlip } from "@/components/ui/mosaic-flip";
    
    <MosaicFlip className="h-96 w-72" back={<Details />}>
      <img src="/cover.jpg" alt="" className="size-full object-cover" />
    </MosaicFlip>

    Props

    PropTypeDefaultDescription
    childrenReactNode—Face shown at rest.
    backReactNode—Face revealed on hover, focus or tap.
    gridSizenumber12Pixels per row and column.
    pixelColorstring"#c6ff3d"Color of the covering pixels.
    durationnumber700Total ms for cover + reveal.
    labelstring"Flip card"Accessible label for the card.
    classNamestring—Extra classes for the root element.