Strands

빛 가닥

Flowing ribbons of light with a multi-color gradient.

Also known as: StrandsLight strandsFlowing ribbons

Moves in browsers that support WebGPU

This device could not render the demo — showing a still

React
// Renders only in browsers with WebGPU.
import { Shader, Strands } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <Strands />
    </Shader>
  )
}
Vue
<!-- Renders only in browsers with WebGPU. -->
<script setup lang="ts">
import { Shader, Strands } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <Strands/>
  </Shader>
</template>
Svelte
<!-- Renders only in browsers with WebGPU. -->
<script>
  import { Shader, Strands } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <Strands />
</Shader>
Solid
// Renders only in browsers with WebGPU.
import { Shader, Strands } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <Strands />
    </Shader>
  )
}
JavaScript
// Renders only in browsers with WebGPU.
// expects <canvas id="canvas" style="width:100%;height:320px"></canvas> on the page
import { createShader } from 'shaders/js'

const shader = await createShader(document.getElementById("canvas"), {
  components: [
    {
      type: 'Strands',
    }
  ]
}, { disableTelemetry: true })

Props · Strands

Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).

NameValueDefaultRange / optionsDescription
speedSpeed0.50 – 2 (step 0.1)Overall animation speed
amplitudeAmplitude20 – 5 (step 0.1)How far the strands wave away from their resting line
frequencyFrequency0.30 – 5 (step 0.1)How many waves run along each strand
lineCountStrand Count81 – 16 (step 1)Number of strands
lineWidthStrand Width0.050 – 1 (step 0.05)Thickness of each strand’s solid core
softnessStrand Softness0.050 – 1 (step 0.05)Softness of each strand’s edge (0 is crisp, higher is feathered)
spreadSpread0.20 – 1 (step 0.05)How far the strands fan out across the field
pinEdgesPin Edgesfalse—Pin the strands so they converge to the start and end points
stopsColorsSet in code[{"color":"#00e5ff","position":0},{"color":"#5b8cff","pos…—Multi-stop gradient colors (overrides Color A / Color B when set)
colorSpaceColor Spaceoklablinear · oklch · oklab · hsl · hsv · lchColor space used to blend the gradient
colorScaleColor Scale11 – 6 (step 1)How many times the gradient repeats along the strands
colorVarianceColor Variance10 – 1 (step 0.05)At 0 every strand shares the same color; at 1 the strands spread across the full gradient
colorSpeedColor Speed10 – 2 (step 0.05)Speed at which the colors flow along the strands (loops)
startStart
x0y0.5
{"x":0,"y":0.5}x, y: 0 – 1Starting point of the strands
endEnd
x1y0.5
{"x":1,"y":0.5}x, y: 0 – 1Ending point of the strands

Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id

It looks like thin ribbons moving across the canvas, with color flowing along each strand.

`lineCount` from 1–16 sets how many strands appear. `amplitude` from 0–5 changes their sway, while `frequency` from 0–5 changes the number of bends along each one. `spread` from 0–1 controls how far they fan out, and `colorSpeed` from 0–2 sets the color flow pace.

Strands draws its own layer. It reads clearly over a dark surface or a simple gradient; too many lines or fast color movement can compete with other content.

When to use

Use it for a flowing-light hero, a music or media background, or a softly animated divider. Avoid placing it in the foreground of a screen with dense small text or numbers.

Open as page ↗