Backgrounds

Strands

Glowing wavy light-strands with an optional glass refraction lens.

Adapted from React Bits

Install

bun add ogl

Then copy 2 files into your project:

  • components/registry/strands/strands.tsx
  • hooks/use-animation-loop.ts

Props

PropTypeDefaultDescription
countnumber13Number of strands.
scalenumber0.9Field size — lower zooms out, higher magnifies the strands.
speednumber0.8Animation speed.
amplitudenumber1.25Wave amplitude.
wavinessnumber1Waviness of the strands.
thicknessnumber1.55Strand thickness.
strandWidthnumber100Horizontal reach as a percentage — 100 spans to the glass rim.
glownumber0.25Glow strength.
spreadnumber1.65Vertical spread.
intensitynumber1Color intensity.
saturationnumber1Color saturation.
opacitynumber0.9Overall opacity.
glassbooleantrueOverlay a glass refraction lens.
refractionnumber1.3Glass refraction strength.
dispersionnumber0.5Chromatic dispersion.

What It Demonstrates

Loop
An animation that repeats, a set number of times or infinitely.
Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.
Blur
A blur filter used to soften an element or mask tiny imperfections.

Related Components

Appears In