Smoke Flow

연기 흐름

Moving the pointer emits smoke that swirls along its path and fades.

Also known as: SmokeFlowcursor smokesmoke trail

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

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

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

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

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

Props · SmokeFlow

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

NameValueDefaultRange / optionsDescription
colorAFresh Color#e29c8b—Color of fresh smoke
colorBAged Color#d517f9—Color smoke transitions to as it ages
stopsColorsSet in codenull—Multi-stop gradient colors (overrides Color A / Color B when set)
intensityIntensity10.1 – 2 (step 0.05)How much smoke is emitted as you move the cursor
emitRadiusPuff Size0.070.01 – 0.3 (step 0.01)Size of smoke puff emitted at cursor
momentumMomentum200 – 50 (step 1)How much cursor velocity is transferred into the smoke (higher = more directed flow)
dissipationDissipation0.50.05 – 3 (step 0.05)How fast smoke fades over time
detailSwirl Detail100 – 60 (step 1)Fine-scale swirling detail driven by vorticity confinement
gravityGravity2-5 – 5 (step 0.05)Vertical drift — negative floats up, positive sinks down
colorDecayColor Decay0.50 – 3 (step 0.1)How quickly smoke shifts from fresh to aged color
colorSpaceColor SpaceOKLABlinear · oklch · oklab · hsl · hsv · lchColor space for color interpolation

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

Smoke appears along the pointer’s path and keeps swirling after it lifts. It is like moving a stick of incense and watching its smoke trail follow behind.

`intensity` sets how much smoke is emitted (default 1, range 0.1–2), `emitRadius` sets each puff’s size (default 0.07, range 0.01–0.3), and `momentum` controls how much pointer velocity carries into the smoke (default 20, range 0–50). `dissipation` controls fading (default 0.5, range 0.05–3); `gravity` controls vertical drift (default 2, range -5–5).

This generator draws on its own and needs no input image. A plain background makes the trail easy to see; because the motion lingers, avoid keeping it behind text.

When to use

Use it for a pointer-trail hero interaction, a short drawing experience, or an atmospheric transition. Avoid it on screens with long passages or instructions people need to scan quickly.

Open as page ↗