Haim Repaél Azoulay

Light Runner Path

Shaders 1

About

A light that runs along any SVG path, with fibre-optic tips that flare as it passes. Use it as a connector, a progress route or a loader. Colors come from your theme: it glows on dark surfaces and draws as ink on light ones.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Light Runner Path to your project and fits it to your theme.

Code

How Light Runner Path is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

// Copyright (c) 2026 haim repael azoulay. Released under the MIT License.
import LightRunner, { type LightRunnerProps } from "@/components/ui/light-runner-path"

// Colors are left to the theme: the route uses muted-foreground, the light
// uses primary. Pass baseColor / lightColor / glowColor / bulbColor to override.
const settings = {
  playback: true,
  speed: 0.22, // laps per second
  direction: 1, // 1 forward, -1 backward
  runners: 1, // light heads per lap (1-4)
  headLength: 10,
  tailLength: 150,
  tailBrightness: 0.75,
  trailSoftness: 0.7,
  intensity: 1,
  baseOpacity: 0.5, // resting route opacity
  glowRadius: 14,
  glowStrength: 1,
  strokeWidth: 3,
  bulbRadius: 6,
}

// The route is drawn in a 1000 x 400 box; each stop sits on a bulb (0, 0.5, 1 along the path)
// and its label hangs just below it at any width.
const ROUTE = "M 110 200 C 270 200, 340 90, 500 90 S 730 200, 890 200"
const STOPS = [
  { label: "Request", note: "Client", left: "11%", top: "calc(50% + 14px)" },
  { label: "Edge", note: "Cache and auth", left: "50%", top: "calc(22.5% + 14px)" },
  { label: "Origin", note: "Database", left: "89%", top: "calc(50% + 14px)" },
]

export default function LightRunnerPathDemo(props: Partial<typeof settings>) {
  const s = { ...settings, ...props } as LightRunnerProps
  return (
    <div className="flex min-h-[480px] w-full flex-col items-center justify-center gap-6 bg-background p-4 text-foreground sm:p-8">
      {/* A route with three stops: the runner flares each bulb as it passes */}
      <div className="w-full max-w-2xl rounded-xl border border-border bg-card text-card-foreground shadow-sm">
        <div className="flex items-center justify-between border-b border-border px-5 py-3">
          <span className="text-sm font-medium">Request path</span>
          <span className="text-xs text-muted-foreground">42 ms, 3 hops</span>
        </div>
        <div className="relative aspect-[10/4] w-full">
          <LightRunner path={ROUTE} viewBox={{ width: 1000, height: 400 }} bulbs={[0, 0.5, 1]} {...s} />
          {STOPS.map((stop) => (
            <div
              key={stop.label}
              className="absolute -translate-x-1/2 whitespace-nowrap text-center"
              style={{ left: stop.left, top: stop.top }}
            >
              <div className="text-sm font-medium">{stop.label}</div>
              <div className="text-xs text-muted-foreground">{stop.note}</div>
            </div>
          ))}
        </div>
      </div>

      {/* A closed loop with two runners works as a loader */}
      <div
        role="status"
        className="flex items-center gap-3 rounded-full border border-border bg-card py-2 pl-2 pr-5 text-card-foreground shadow-sm"
      >
        <div className="h-9 w-9">
          <LightRunner
            {...s}
            path="M 50 8 A 42 42 0 1 1 49.9 8 Z"
            viewBox={{ width: 100, height: 100 }}
            bulbs={[]}
            runners={2}
            speed={0.6}
            strokeWidth={2.5}
            headLength={5}
            tailLength={48}
            glowRadius={5}
          />
        </div>
        <span className="text-sm font-medium">Syncing workspace</span>
      </div>
    </div>
  )
}

More by Haim Repaél Azoulay

View all
  • Glass Glare

    Glass Glare

    79
  • Card Tilt Depth

    Card Tilt Depth

    3
  • Nebula Space Background

    Nebula Space Background

More in Shaders

View all
  • Glass Fold

    Glass Fold

    485
  • Illos Knowledge Sources

    Illos Knowledge Sources

    52
  • Shader Animation

    Shader Animation

    3.9K
  • Phosphor 30

    Phosphor 30

    311
  • Paper design shader Background

    Paper design shader Background

    699
  • NeonRGBTextEffect

    NeonRGBTextEffect

    153
  • LightSpeed

    LightSpeed

    242
  • Black Hole

    Black Hole

    42