Library navigation

Chroma Background

Flowing chromatic ribbons with subtle grain, adjustable hue, and gentle pointer distortion.

Liquid color ribbons drift through a dark background with subtle film grain. Moving the pointer gently bends the surrounding color field without moving the container.

Chroma Background is a vgpu-powered React UI component that renders a WGSL shader through WebGPU. It supports reduced motion and provides a fallback for browsers without WebGPU.

Installation

text
Add the chroma-background component from Hangry UI to this project.
Use the project's package manager to run:
shadcn@latest add https://ui.razeev.com/r/chroma-background.json
Integrate the component with the existing layout and styling.
Keep its interactions and reduced-motion support intact.

How to use

tsx
import { ChromaBackground } from "@/components/hangry-ui/shader/chroma-background";
<ChromaBackground speed={0.2} intensity={0.9} hueShift={0} grain={0.035}
className="grid place-items-center p-12">
<h2 className="typography-section-title text-white">A little more color.</h2>
</ChromaBackground>

Props

PropTypeDefaultDescription
speednumber0.2Nonnegative animation speed. Set 0 to freeze the ambient flow.
intensitynumber0.9Color brightness, clamped to 0–2.
hueShiftnumber0Color phase offset in degrees.
grainnumber0.035Static grain strength, clamped to 0–0.2.
interactivebooleantrueBend and brighten the color field near the pointer.
childrenReactNode—Content displayed above the shader.
Native div propsComponentProps—Classes, styles, IDs, and accessibility attributes.

Dependencies

  • Motion
  • vgpu