crucıble

Flurry

Quantized pixel snowfall: chunky flakes locked to a crisp unsmoothed pixel grid fall on three parallax depth layers with distinct speeds, sizes and ice-blue tints. Per-flake sine wander, seeded wind gusts that shear layers by depth, and flakes that settle briefly into 1-block drifts on an invisible floor. Canvas 2D, seeded, offscreen-paused, reduced-motion-safe.

canvasfree

Installation

CLI

npx shadcn@latest add @crucible/flurry

Props

PropTypeDefaultDescription
colorsstring[]["#eff6ff", "#bfdbfe", "#93c5fd"]Layer tints, nearest → farthest. Index 0 colors the big foreground flakes, 1 the mid layer, 2 the distant dust. Defaults to an icy white-to-blue ramp on a cold near-black bed — pass warm grays for ash, greens for pollen, anything for confetti-weather.
densitynumber1Flake-count multiplier across all layers, 0.2–3.
speednumber1Fall / gust speed multiplier. 1 = a lazy flurry.
windnumber1Gust strength multiplier, 0–3. Gusts arrive on a seeded schedule and shear every layer proportionally to its depth; 0 disables them.
driftnumber6Constant fall angle in degrees from vertical (positive leans right). Clamped −45…45.
pixelSizenumber3Chunk size of one "pixel" in CSS px — flakes snap to this grid. Clamped 2–8.
settlebooleantrueLet flakes settle on an invisible floor line: each lands, flattens into a 1-block drift for a moment, then fades and recycles.
intensitynumber1Overall flake brightness, 0–2.
seednumber1Deterministic seed — same seed always renders the same snowfall.
dprnumber2devicePixelRatio ceiling. Clamped 1–2.
pausedbooleanfalseFreeze the flurry at a static mid-fall scatter.
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.