Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Flickering Grid

ProNew

A canvas of small squares that flicker at random, like a wall of status LEDs.

Installation

pnpm dlx shadcn@latest add @viewport/flickering-grid

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
sizenumber

Side of each square in pixels.

4
gapnumber

Space between squares in pixels.

6
flickernumber

Chance, per square per second, of changing brightness.

0.3
maxOpacitynumber

Brightest a square can get, from 0 to 1.

0.35
colorstring

Square color. Defaults to the current text color.

—
classNamestring—

Accessibility

  • Canvas is aria-hidden.
  • Holds still under reduced motion and pauses off screen.
  • Follows the theme color and redraws only the squares that change.