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
Installation
npx shadcn@latest add @glint-ui/pixel-backgroundFirst time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glint-ui-seven.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
| Prop | Type | Default | Description |
|---|---|---|---|
| pixelSize | number | 26 | Px per tile. |
| gap | number | 2 | Px between tiles. |
| colors | string[] | ["#0b1026","#1e3a8a","#7c3aed","#f472b6"] | Palette the waves sweep through, dark to bright. |
| speed | number | 1 | Wave speed multiplier. |
| brightness | number | 0.7 | Overall tile brightness. |
| interactive | boolean | true | Tiles brighten near the cursor. |
| radius | number | 160 | Cursor glow radius in px. |
| className | string | — | Extra classes for the root element. |