MenuClose

Particle Field — React Animated Background

Procedural cell-hashed particles with drift and size breathing — a living texture, no sprite sheet.

View source
PreviewWEBGPU
Starting live preview

Usage

import { ParticleField, PARTICLE_PRESETS } from "@/components/ParticleField";

export function AmbientBanner() {
  return (
    <div style={{ position: "relative", height: 420 }}>
      <ParticleField {...PARTICLE_PRESETS.frost}
        {...{
          interactive: true,
          density: 0.45,
          size: 0.16,
          speed: 0.8,
          color: "#a8d8ff"
        }}
      />
      <div style={{ position: "relative", zIndex: 1 }}>…</div>
    </div>
  );
}
Implementation notes & API

Purpose: soft ambient particle texture for banners and cards; reads as depth rather than decoration when kept below 0.5 density. Mount: absolute layer inside a sized container. Props: color, density (0-1), size (0-1 dot scale), speed. Pointer: parallax viewpoint offset, near bokeh orbs shifting most; interactive={false} pins it. Guardrails: keep density under 0.6 for legibility of overlaid text; WebGPU required with fallback prop.

PropertyTypeNotes / default
interactivebooleanfalse in the library; enabled in this preview
fallbackReactNodeShown when the renderer is unavailable
className / stylestring / CSSPropertiesApplied to the outer container
View source on GitHubFree for commercial projects · MIT