Skip to content

    Browse components

    Block Dissolve

    On hover or focus, an image dissolves into a second one through a wave of pixel blocks spreading from the pointer.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/block-dissolve

    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/block-dissolve.json

    Usage

    import { BlockDissolve } from "@/components/ui/block-dissolve";
    
    <BlockDissolve src="/before.jpg" hoverSrc="/after.jpg" alt="Product shot" className="h-96 w-72 rounded-2xl" />

    Props

    PropTypeDefaultDescription
    srcstring—Image shown at rest (CORS-enabled).
    hoverSrcstring—Image revealed on hover.
    altstring—Accessible description.
    blockSizenumber18Pixel block size in px.
    durationnumber700Transition length in ms.
    accentstring"#c6ff3d"Color of the dissolve's leading edge.
    classNamestring—Extra classes for the root element.