Ballmac UI home

Animated Grid

A decorative hairline grid background where a few random cells softly light up and fade, like instrument lights. SVG, hydration-safe, static under reduced motion.

Observability

Every request, measured.

Traces, logs and metrics on one timeline, with no sampling below 10k requests a minute.

Installation

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

Usage

import { AnimatedGrid } from "@/components/ballmac/animated-grid"

The full example is in the Code tab above.

API reference

PropTypeDefault
cellSize

Width and height of one cell in pixels.

number40
count

How many cells are lit at the same time.

number8
interval

Milliseconds between one cell fading out and a new one lighting up.

number700
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 <AnimatedGrid /> as the first child of a relative container (it is absolute inset-0, aria-hidden, pointer-events-none) and put content after it with relative positioning. Lit cells are picked on the client after mount, so SSR output is just the grid. With the shadcn MCP server set up (guide), ask your agent:

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

Use it for

  • Hero or section backgrounds on developer-tool and SaaS landing pages
  • Empty states or sign-in screens that need quiet texture

Not for

  • Behind dense text or data (it competes with content)
  • More than one per screen

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

Credits

Free to use in personal and commercial projects.