crucıble

Arc

An electric-storm background: seeded midpoint-displacement lightning bolts fork down from a faint cloud glow toward random ground points, drawn as layered strokes (wide glow, colored haze, white-hot core) with flicker re-strikes and afterimage persistence. Click to call a strike to your cursor. Photosensitivity-safe by design: shaped pulse trains (max 3 peaks, 130ms+ apart), a hard 1.25s strike cooldown, and a flashCap clamp on full-frame luminance. Canvas 2D, idle-silent between strikes, offscreen-paused, reduced-motion poster frame.

canvasfree

Installation

CLI

npx shadcn@latest add @crucible/arc

Props

PropTypeDefaultDescription
frequencynumber0.3Ambient strikes per second. Clamped 0–0.8; on top of that a hard 1.25s minimum gap between strike starts is always enforced (see the photosensitivity note on the component). 0 = no ambient strikes (click-only when interactive).
branchinessnumber0.55How eagerly bolts fork into side branches, 0 (bare channel) – 1 (heavily forked).
jagnumber1Jaggedness of the bolt path — midpoint-displacement amplitude multiplier, 0–2.
glowRadiusnumber26Width of the outer glow stroke in CSS px.
colorsstring[]["#dbeafe", "#3b82f6", "#05070d"][core, haze, background]. Core is the white-hot channel, haze the colored glow/sky wash, background the storm-sky bed.
interactivebooleantrueClick/tap calls a strike down to the cursor (with a charge-up shimmer).
speednumber1Flicker/decay tempo and ambient-cadence multiplier. Safety clamps below are absolute and unaffected.
intensitynumber1Overall brightness of strokes, impact glow and sky wash, 0–2.
flashCapnumber0.14Photosensitivity clamp: the maximum opacity of the full-frame sky-wash flash. Hard-clamped to ≤0.25 internally — no prop value can produce a large-area luminance jump.
pausedbooleanfalseFreeze at the static poster frame (one forked bolt at full brightness).
seednumber1Deterministic seed for bolt geometry and the strike schedule. Give each instance on a page a different seed to desynchronize their storms.
dprnumber2devicePixelRatio ceiling. Clamped 1–2.
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.