OPUS/UI

Navigation

Pixel Trail

A grid that lights up cell by cell behind the pointer — strokes are rasterised so fast swipes leave no gaps — fading back with a shrink. Idle sparkles keep it alive.

canvaspixelpointer5 files · 417 locdeps: clsx, tailwind-merge

Installation

With the shadcn CLI, pointing at this platform’s registry:

npx shadcn@latest add https://opusui.131199999.xyz/r/pixel-trail.json

Or offline, straight from your opus55 checkout (copies every file it needs):

node ../tailwind_component/opus55/scripts/add.mjs pixel-trail

Usage

import { PixelTrail } from "@/components/opus/backgrounds/pixel-trail";

<PixelTrail cell={22} className="absolute inset-0" />

API

PropTypeDefaultDescription
colorsstring[]—Colours cycled along each stroke.
gridColorstring"rgba(255,255,255,0.04)"Grid lines (use "transparent" to hide).
cellnumber22Cell size (px).
fadenumber1.2Seconds to fade.
brushnumber1Brush radius in cells.
sparklebooleantrueRandom idle sparkles.
interactivebooleantrueReact to the pointer (tracked on window).
classNamestring—Wrapper classes — `absolute inset-0` to fill a relative parent.
childrenReactNode—Optional content rendered above the canvas.

Notes

  • Canvas 2D with a device-pixel-ratio aware backing store (capped at 2×).
  • The animation loop stops off-screen and in hidden tabs; resize re-seeds the scene.
  • prefers-reduced-motion: reduce draws a single static frame.

Command palette