crucıble

Latticework

An interactive dot grid: cool-steel silver dots heat white → cyan as the cursor approaches, with a configurable falloff curve; a click or tap sends a hammer-strike shockwave ring through the grid. Pauses offscreen. Freezes to a static, gently lit frame under prefers-reduced-motion. Strikes stack, a `strike()` ref handle lands them programmatically, and a ghost pointer warms the grid when untouched.

canvasfree

Installation

CLI

npx shadcn@latest add @crucible/latticework

Props

PropTypeDefaultDescription
refReact.Ref<LatticeworkHandle>Imperative handle — see {@link LatticeworkHandle}.
spacingnumber34Spacing between dots in px.
dotRadiusnumber1.4Resting dot radius in px.
radiusnumber180Proximity radius in px within which dots warm up.
falloffLatticeworkFalloff"gaussian"Shape of the heat falloff curve across the proximity radius.
colors[string, string, string]steel silver → white → cyanCold → mid → hot color ramp.
responsivenessnumber0.12How quickly dots ease toward their target heat, 0–1 per frame at 60fps.
dprnumber2devicePixelRatio ceiling.
strikeStrengthnumber1Pointer-down "hammer-strike" strength: an expanding ring of displacement and temporary heat radiates from the strike point. 0 disables strikes. On coarse pointers a tap lands one strike.
pausedbooleanFreeze the field — pointer heat and strikes stop and it settles on the same static, gently lit resting frame used under reduced motion.
idlebooleantrueIdle autoplay: after ~1.5s with no real pointer, a seeded ghost pointer drifts over the grid on a slow Lissajous path, warming the dots it passes and landing an occasional strike, so the field never looks dead in thumbnails and heroes. The real pointer takes over instantly. Never runs under reduced motion.
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.