Ballmac UI home

Flickering Grid

A canvas grid of small squares that flicker at random brightness, like a busy status board. Pixel-snapped, token-colored, DPR aware, pauses off-screen, static under reduced motion.

Realtime

Every node, every second.

Live health for 12,000 machines, streamed to one screen without a refresh.

Installation

$ pnpm dlx shadcn@latest add @ballmac/flickering-grid

Usage

import { FlickeringGrid } from "@/components/ballmac/flickering-grid"

The full example is in the Code tab above.

Examples

Accent card

Requests today

48.2M

Up 12% from yesterday

API reference

PropTypeDefault
squareSize

Side of each square in pixels.

number4
gap

Space between squares in pixels.

number6
flickerChance

Chance per second that a square picks a new brightness (0–1+).

number0.3
maxOpacity

Brightest a square gets (0–1).

number0.3
color

Square color: a CSS variable name ("--foreground") or any CSS color.

string"--foreground"
fade

Fade the grid out toward the edges with a radial mask.

booleantrue

Also accepts the standard attributes of its root element.

Use with AI

Place <FlickeringGrid /> as the first child of a relative, overflow-hidden container; it fills it (absolute inset-0, aria-hidden, pointer-events-none). Tune squareSize, gap and maxOpacity for density and contrast. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Flickering Grid (@ballmac/flickering-grid) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Section or hero backgrounds for infrastructure, data or developer products
  • Feature cards that should feel alive without a focal animation

Not for

  • Behind small or low-contrast text (keep maxOpacity low or add a scrim)
  • Very large full-page areas on low-power devices (use dot-pattern)

Registry JSON: https://ui.ballmac.com/r/flickering-grid.json

Credits

Free to use in personal and commercial projects.

npm
None