crucıble

Confetti

Celebration confetti: seeded chips and streamers fall under gravity with per-piece spin, tumble (foreshortening flip with a shadowed backface) and flutter. Opens with an upward burst on mount and keeps firing occasional puffs, then settles into a gentle endless drift. Festive-but-tasteful density, colors/speed/count knobs. Canvas 2D, seeded, offscreen-paused, reduced-motion-safe (static settled scatter).

canvasfree

Installation

CLI

npx shadcn@latest add @crucible/confetti

Props

PropTypeDefaultDescription
colorsstring[]["#ff7eb6", "#ffd166", "#68e0a8", "#6bb8ff", "#b892ff", "#ff9a6b"]Confetti palette — pieces are colored evenly across this list. Defaults to a tasteful festive spread (pink, gold, mint, blue, violet, peach) on near-black. Pass a tighter set (e.g. two brand tones) for on-brand celebration, or a single-hue array for monochrome fall.
speednumber1Fall / flutter / burst-cadence multiplier. 1 = default, 2 = twice as lively.
countnumber1Piece-count multiplier over the area-based default, 0.2–3.
intensitynumber1Overall piece opacity and sheen, 0–2.
dprnumber2devicePixelRatio ceiling. Clamped 1–2.
pausedbooleanfalseFreeze at a static, settled scatter of confetti.
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.