Skip to content

Spectral Drift Background

Fluid ribbons of light with interactive distortion.

LIVE PREVIEWInteract with the component
Install dependencies

npm install three @react-three/fiber

CSS Modules

Usage

Matches your current playground settings.

jsx
import SpectralDriftBackground from "./SpectralDriftBackground";
export default function Example() {
return (
<SpectralDriftBackground
colors={[
"#020617",
"#22d3ee",
"#a855f7",
"#4f46e5"
]}
intensity={1}
rotation={45}
speed={0.2}
autoRotate={0}
scale={1}
frequency={1}
warpStrength={1}
mouseInfluence={1}
parallax={0.5}
noise={0.08}
minHeight={360}
/>
);
}

Using Spectral Drift Background

Use this effect behind a hero or a section whose foreground content is supplied by the page. minHeight reserves its space.

Adjust speed and mouseInfluence separately for ambient and pointer motion. transparent lets the effect blend with a background already supplied by the parent.

Props

NameTypeRequiredDefaultDescription
classNamestringNoundefinedAdditional CSS class names, merged with base component styles.
mouseRefReact.MutableRefObject<{ x: number; y: number }>NoundefinedOptional pointer ref for external cursor tracking, values in the range [-1, 1].
colorsstring[]No["#020617", "#22d3ee", "#a855f7", "#4f46e5"]Array of up to eight colors used to blend the flowing bands.
intensitynumberNo1Overall brightness of the band colors.
rotationnumberNo45Base rotation angle for the flow field in degrees.
speednumberNo0.2Speed multiplier for the drifting motion.
autoRotatenumberNo0Additional automatic rotation speed in degrees per second.
scalenumberNo1Zoom level for the bend pattern.
frequencynumberNo1Frequency of the bend waves across the backdrop.
warpStrengthnumberNo1How strongly the bands warp and curl.
mouseInfluencenumberNo1How much the cursor pulls the bands.
parallaxnumberNo0.5How much the field shifts with cursor movement.
noisenumberNo0.08Amount of grain added to the backdrop.
minHeightnumber | stringNo360Minimum height for the component container. Accepts a number (pixels) or any valid CSS height string.
transparentbooleanNotrueWhether the background alpha is transparent.

Related components

Glacial Rift

Backgrounds

Sculpted ice walls frame a luminous, slowly shifting blue crevasse.

Solar Veil

Backgrounds

Copper light curtains hang in fine, flowing folds above a dark horizon.

Opal Current

Backgrounds

Pearlescent liquid folds shift between jade, rose and soft silver.

Event Horizon

Backgrounds

A dark celestial silhouette bends warm orbital threads into a glowing disc.