crucıble

Fireflies

A calm, magical night: warm glowing points drift along gentle seeded wandering paths, each softly breathing inside an additive-glow halo and trailing a short fading wake. Near fireflies big/bright/roaming, far ones dim pinpricks — real depth parallax. 2D canvas with additive blending, seeded PRNG for a deterministic SSR-safe layout, pauses offscreen, honors prefers-reduced-motion with a still field of glowing points.

canvasfree

Installation

CLI

npx shadcn@latest add @crucible/fireflies

Props

PropTypeDefaultDescription
countnumber46How many fireflies drift in the field. Clamped 8–160. Near ones are large, bright and roam widely; far ones are tiny, dim pinpricks — real depth.
colorsstring[]["#fff1c1", "#ffd166", "#b5e48c"]Glow palette, hottest → coolest, mapped across the depth field (nearest fireflies take the first color). Defaults to a warm bioluminescent glow: soft gold melting into a gentle leaf-green. Pass your own for a different night — cool ["#dbeafe", "#a5f3fc", "#818cf8"] reads as winter starlight.
speednumber1Drift / breathing-speed multiplier. 1 = default, 2 = twice as lively.
intensitynumber1Overall glow brightness and bloom, 0–2.
seednumber1Deterministic seed for the wander layout — same seed, same night.
dprnumber2devicePixelRatio ceiling. Clamped 1–2.
pausedbooleanfalseFreeze the field at a static, aesthetic frame of glowing points.
Also accepts all props of React.ComponentPropsWithoutRef<"div">they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, pauses offscreen and on hidden tabs, and passes className through.