Effect · top layer

String Lights effect

The Zeenat string lights effect hangs a responsive SVG cable with bounded, colored bulbs along the top or bottom of a website. It is part of the Winter and Festive Lights presets.

Installation and imports

Install Zeenat once, then use the aggregate effects entry or the smallest explicit subpath. Both paths are exported by package version 0.3.0.

Install
npm install zeenat
Imports
import { stringLights } from "zeenat/effects";
// or
import { stringLights } from "zeenat/effects/string-lights";

Basic usage

Lights.tsx
import { ZeenatScene } from "zeenat";
import { stringLights } from "zeenat/effects/string-lights";

const effects = [stringLights()];

export function Decoration() {
  return <ZeenatScene effects={effects} />;
}

stringLights() options

Properties marked required have no factory default. Every other value below is taken from the current TypeScript source.

PropertyTypeRequiredDefaultDescription
colorsreadonly string[]No["#fbbf24", "#fef3c7", "#f97316"]CSS colors cycled across bulbs.
countnumberNoderived from widthExplicit base bulb count. When omitted, spacing and viewport width determine it.
spacingnumberNo78Approximate bulb spacing in CSS pixels when count is omitted; minimum 30.
position"top" | "bottom"No"top"Viewport edge used for the cable.
depthnumberNo54 small / 72 largeCable SVG height in CSS pixels; minimum 28.
twinklebooleanNotrueEnables alternating bulb opacity and scale during full motion.
layer"background" | "ambient" | "foreground" | "top"No"top"Semantic layer used to order the effect inside the Zeenat scene.
ordernumberNoOptional ordering value among effects in the same semantic layer.

Examples

Subtle

Subtle
stringLights({ count: 9, depth: 46, colors: ["#fef3c7"], twinkle: false })

Intense

Intense
stringLights({ count: 26, colors: ["#fbbf24", "#fb7185", "#38bdf8"], depth: 88 })

Combined

Combined
const effects = [stringLights(), lanterns({ count: 4 }), sparkles({ colors: ["#fbbf24"], count: 8 })];

Reduced motion

The cable and bulbs remain visible as a static decoration; twinkle is omitted.

Read the complete reduced-motion contract

Performance notes

Uses one responsive SVG. Bulb count is bounded, scaled for viewport and animated through WAAPI only when full motion is active.

Zeenat performance architecture