MenuClose

Ribbon Field — React Animated Background

Three Gaussian light ribbons drifting over a dot-matrix grid with bloom cores and film grain — WGSL port of ThreeUI's RibbonField (MIT).

View source
PreviewWEBGPU
Starting live preview

Usage

import { RibbonField, RIBBON_FIELD_PRESETS } from "@/components/RibbonField";

export function RibbonHero() {
  return (
    <div style={{ position: "relative", width: "100%", height: 420 }}>
      <RibbonField {...RIBBON_FIELD_PRESETS.classic}
        {...{
          interactive: true,
          speed: 1,
          intensity: 1,
          drift: 0,
          grain: 1
        }}
      />
    </div>
  );
}
Implementation notes & API

Purpose: dark hero/backdrop with three drifting light ribbons on a dot-matrix grid; reads as a high-tech data surface. Mount: wide container (hero band); opaque near-black base — no background needed behind it. Props: speed, intensity (ribbon brightness), drift (-1..1 horizontal sway), grain (micro-noise strength). Pointer: ribbon drift follows the cursor x (the original threeui interaction); interactive={false} pins drift to the prop. Guardrails: the dot grid is pixel-true (component measures its own backing store); keep the canvas unscaled (no CSS transform) or dots blur; 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