Skip to content
WANCRAFT

E.51Backgrounds & Effects

Signal Lines

Stacked horizontal lines displaced by layered noise waves — a ridgeline, oscilloscope feel.

NewReactCanvasTailwindadvanced

Overview

Signal Lines stacks horizontal lines and displaces each one with layered simplex noise and a faint sine ripple, shaped by a soft envelope that keeps the edges calm and the centre lively. With occlusion on, every line hides the lines behind it like a ridgeline plot — done with a destination-out erase, so it works on any background without knowing its colour. A mouse pointer raises a localized bump in the nearest lines. Lines can follow the theme ink, use your accent, or blend from ink at the back to accent at the front. The loop idles when frozen, stops offscreen and in hidden tabs, and reduced motion draws one still frame.

01Installation

Method 01 · Registry

CLI verified

Uses the shadcn CLI in a project initialised with shadcn init. Installs the file to components/ui/signal-lines.tsx and adds its dependencies.

npx shadcn@latest add https://wancraft.my/r/signal-lines.json

Method 02 · Copy and paste

  1. 1. No extra dependencies — React and Tailwind CSS only.
  2. 2. Copy the source from the Code tab into components/ui/signal-lines.tsx.
  3. 3. Import it and adjust props.
Dependencies
None
Peer
react ≥ 18, tailwindcss ≥ 4
Added
13 Oct 2026
Updated
—

02Usage

The default configuration. Change properties above to generate a tailored example in the Usage tab.

example.tsx
import { SignalLines } from "@/components/ui/signal-lines";

export function SignalLinesExample() {
  return (
    <div className="relative h-80 w-full overflow-hidden rounded-xl">
      <SignalLines />
    </div>
  );
}

03Props

PropTypeDefaultDescription
lineCountnumber32Number of stacked lines (min 2).
amplitudenumber40Peak displacement in px.
frequencynumber1.5Waviness — roughly the number of features across the width.
speednumber1Animation speed multiplier; 0 freezes the waves.
strokeWidthnumber1.25Line stroke width in px.
occlusionbooleantrueEach line hides the lines behind it (ridgeline plot).
tone"ink" | "accent" | "gradient""ink"Theme ink, all accent, or ink at the back blending to accent at the front.
colorstring"#FF7448"Accent colour (any CSS colour).
interactivebooleantrueA mouse or pen pointer raises a localized bump.
childrenReactNode—Optional content layered above the lines.
...propsHTMLAttributes<HTMLDivElement>—Forwarded to the root, which is absolute inset-0 — place it inside a positioned parent.

04Features

  • 01Two octaves of inline simplex noise plus a sine ripple per line
  • 02Background-agnostic occlusion via destination-out — no background colour needed
  • 03Soft centre envelope for the classic ridgeline silhouette
  • 04Eased pointer bump across the nearest lines
  • 05Ink follows light/dark themes; three tone modes
  • 06DPR-aware canvas (capped at 2), ResizeObserver, pauses offscreen and in hidden tabs
motion · continuousinput · pointerinput · viewport

05Accessibility

  • The canvas is aria-hidden and ignores pointer events; layered content stays fully interactive.
  • prefers-reduced-motion draws a single still frame and disables the pointer bump.
  • Only mouse and pen pointers raise the bump, so touch scrolling never triggers redraws.