import { mountNoiseFlow } from '@elysian256/noise-wave-flow';
// Creates and injects a <canvas> automatically
const flow = mountNoiseFlow(document.getElementById('hero'), {
color: '255,255,255',
alpha: 0.14,
});
flow.update({ alpha: 0.06 }); // live-patch without restart
flow.destroy(); // stop and remove canvas
import { useNoiseFlow } from '@elysian256/noise-wave-flow/react';
function Hero() {
const { canvasRef, containerRef } = useNoiseFlow({
color: '255,255,255',
alpha: 0.14,
});
return (
<section ref={containerRef} style={{ position: 'relative' }}>
<canvas ref={canvasRef} style={{
position: 'absolute', inset: 0,
width: '100%', height: '100%', pointerEvents: 'none',
}} />
<div style={{ position: 'relative', zIndex: 1 }}>
{/* your content */}
</div>
</section>
);
}
| Option | Default | Description |
|---|---|---|
spacing | 28 | Grid-point distance in px |
steps | 5 | Streamline steps per seed point |
stepLen | 8 | Px per step at full mouse intensity |
idleStep | 2.5 | Px per step at idle |
windRadius | 200 | Cursor wind influence radius in px |
mouseLerp | 0.07 | Mouse position lerp speed (0–1) |
windLerp | 0.18 | Wind velocity lerp speed (0–1) |
intensityLerp | 0.055 | Hover fade-in / fade-out speed (0–1) |
color | '255,255,255' | RGB string for rgba(), e.g. '37,99,235' |
alpha | 0.3 | Base opacity at idle |
trackMouse | true | Enable wind-cursor effect |
trackScroll | true | Enable scroll-drift on streamlines |
worldOffset | null | {x,y} | () => {x,y} | 'screen' — offset noise coords across canvases |