Skip to content

    Browse components

    Pixel Background

    A coarse pixel mosaic whose tiles drift through a palette in slow waves and light up around the cursor. Canvas 2D.

    Pixel Background

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/pixel-background

    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/pixel-background.json

    Usage

    import { PixelBackground } from "@/components/ui/pixel-background";
    
    <div className="relative h-96">
      <PixelBackground colors={["#0b1026", "#1e3a8a", "#7c3aed", "#f472b6"]} />
    </div>

    Props

    PropTypeDefaultDescription
    pixelSizenumber26Px per tile.
    gapnumber2Px between tiles.
    colorsstring[]["#0b1026","#1e3a8a","#7c3aed","#f472b6"]Palette the waves sweep through, dark to bright.
    speednumber1Wave speed multiplier.
    brightnessnumber0.7Overall tile brightness.
    interactivebooleantrueTiles brighten near the cursor.
    radiusnumber160Cursor glow radius in px.
    classNamestring—Extra classes for the root element.