crucıble

Sparks

A celebratory spark burst fired imperatively via ref: elongated white, silver, and pale-blue streaks fan outward, fall under gravity, and burn out bright-to-dark, with a fraction bouncing once. Pooled particles, auto-cleanup, offscreen-paused.

canvasfree

Installation

CLI

npx shadcn@latest add @crucible/sparks

Props

PropTypeDefaultDescription
countnumber36Particles per burst.
colorsstring[]white, silver, and pale blueStreak colors, cycled per-particle.
anglenumber90Base launch direction in degrees (0 = right, 90 = up).
spreadnumber130Fan width around angle, in degrees. 360 = fully omnidirectional.
velocitynumber420Initial launch speed, px/s.
gravitynumber900Downward acceleration, px/s².
maxParticlesnumber240Pooled particle capacity — bursts recycle the oldest particle once full.
dprnumber2devicePixelRatio ceiling.
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.