crucıble

Spall

Pixel shatter bursts: an invisible mosaic of chunky cells where a click (or seeded auto-strike) detonates a radial shockwave — struck cells flash ultraviolet, physically eject along the radius with per-cell jitter in crisp integer-snapped steps, then cool and settle home; overlapping bursts interfere additively and hover leaves a faint warm-up trail. Canvas 2D, idle-silent between bursts, seeded, offscreen-paused, reduced-motion-safe.

canvaspro

Installation

CLI

npx shadcn@latest add @crucible/spall

Props

PropTypeDefaultDescription
colors[string, string]["#a78bfa", "#4c1d95"]Two tones [flash, cool]. flash is the hue a cell burns with the instant a shockwave hits it; cool is the deep tone it decays through on the way back to dark. Defaults to ultraviolet — a pale violet flash cooling through deep indigo. Pass warm tones for sparks off steel, or two whites for a mono static-burst look.
speednumber1Shockwave expansion + cooling speed multiplier. 1 = default.
intensitynumber1Overall flash brightness, 0–2.
pixelSizenumber10Size of one mosaic cell in CSS px. Clamped 4–24.
burstRadiusnumber170Shockwave reach of one burst in CSS px. Clamped 40–480.
ejectionnumber1How far struck cells eject along the burst radius, as a multiple of pixelSize (offsets are always snapped to whole pixels — crisp, quantized motion). 0 disables displacement (cells only flash). Clamped 0–3.
decaynumber1Cooling / settle-home rate multiplier — higher fades bursts faster. Clamped 0.25–4.
autoStrikenumber2.6Seconds between seeded automatic strikes while no burst is live. Strikes land at deterministic seeded positions so the surface periodically detonates on its own. 0 disables auto-strikes (interaction only).
interactivebooleantrueDetonate a burst on click/tap and leave a faint warm-up trail on hover.
dprnumber2devicePixelRatio ceiling. Clamped 1–2.
pausedbooleanfalseFreeze at a static frame — one burst frozen at peak radius.
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.