Skip to content
Neon UI
Esc
navigateopen⌘Jpreview
On this page

BannerPattern

The neon.com banner dot pattern as a live WebGL surface.

BannerPattern recreates neon.com’s banner dot pattern as a shader. The construction mirrors the source SVG: a square-dot grid masks a drifting color field — Neon green upper-left, sage bridging the middle, amber strengthening right, a cream hot spot in the corner, rust pooling low — so every dot samples whatever color sits behind it. Per-dot brightness jitter stands in for the source’s fractal-noise grain, and a dim haze of the same field glows behind the grid. Drag the dials — cell and dot size reshape the grid, haze lifts the glow, and the palettes re-tint the field:

dials
palette

Install

npx shadcn@latest add https://ui.neon.com/r/banner-pattern.json

Usage

import { BannerPattern } from "@/components/neon-ui/banner-pattern";

<div className="relative isolate overflow-hidden bg-black">
  <BannerPattern className="absolute inset-0" />
  <div className="relative">{content}</div>
</div>;

Props

PropType
speed?number

Animation speed multiplier; 0 freezes the field.

Typenumber
Default0.5
cell?number

Grid cell size in CSS pixels.

Typenumber
Default8
dotSize?number

0-0.5 dot half-width as a fraction of the cell.

Typenumber
Default0.14
haze?number

0-1 unmasked ambient glow behind the dots.

Typenumber
Default0.5
jitter?number

0-1 per-dot brightness variance.

Typenumber
Default0.35
colors?BannerPatternPalette

The field, painted back to front: [base, green, sage, amber, cream, rust].

TypeBannerPatternPalette
Default["#0a0b09", "#34d59a", "#97b47d", "#feaa2c", "#ffeacc", "#b03323"]

How the dots get their color

The dots are never colored directly. The source SVG repeats an 8px tile as an alpha mask over blurred gradient ellipses; this shader does the same in one pass — build the color field, cut it with the grid, let each dot inherit the field at its position. Recoloring the whole surface is therefore just swapping the field palette; the grid never changes.

Accessibility

  • The canvas is aria-hidden decoration; content stacks above it in the DOM.
  • Renders one static frame under prefers-reduced-motion (and when speed is 0).
  • Foreground text needs its own contrast — add a scrim overlay (the demo shows a bottom bg-gradient-to-t from-black/80 layer).
  • Skips GL work entirely while the canvas is hidden, so it costs nothing behind overlays.