Stripes

스트라이프

Two alternating stripe colors form a repeating pattern that can move.

Also known as: Stripes줄무늬

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, Stripes } from 'shaders/react'

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

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

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

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <Stripes />
    </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: 'Stripes',
    }
  ]
}, { disableTelemetry: true })

Props · Stripes

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

NameValueDefaultRange / optionsDescription
colorAColor A#000000—First stripe color
colorBColor B#ffffff—Second stripe color
angleAngle45-180 – 180 (step 1)Angle of stripes in degrees
densityDensity51 – 30 (step 1)Number of stripe pairs visible
balanceBalance0.50 – 1 (step 0.1)Ratio of the two colors
softnessSoftness00 – 1 (step 0.1)Edge softness
speedSpeed0.2-1 – 1 (step 0.1)Animation speed
offsetOffset00 – 1 (step 0.1)Phase offset for pattern positioning
colorSpaceColor Spacelinearlinear · oklch · oklab · hsl · hsv · lchColor space for interpolation

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

Like striped wallpaper or a sports jersey, parallel bands run across the canvas. When they move, even a flat area gains a sense of flow.

Change the band direction with `angle`; increase `density` to show more stripe pairs. `balance` changes how much of each color is visible. Higher `speed` makes the pattern move faster, while more `softness` blurs the edges between stripes.

This generator fills the canvas and needs no input layer. Moving bands draw attention, so lower their speed and contrast behind text; set `speed` to 0 when the scene should stay still.

When to use

Use it for directional banner backgrounds, repeating product-page decoration, or a short intro that needs motion. Avoid dense, fast stripes when they would compete with text or other movement.

Open as page ↗