Confetti
A `confetti()` function with physics, flutter and three shapes, plus a <ConfettiButton>. One shared canvas, removed when the last piece lands.
canvasimperative2 files · 150 locdeps: clsx, tailwind-merge
Installation
With the shadcn CLI, pointing at this platform’s registry:
npx shadcn@latest add https://opusui.131199999.xyz/r/confetti.jsonOr offline, straight from your opus55 checkout (copies every file it needs):
node ../tailwind_component/opus55/scripts/add.mjs confettiUsage
import { confetti, ConfettiButton } from "@/components/opus/effects/confetti";
confetti({ x: 200, y: 300, spread: 90 });
<ConfettiButton>Celebrate</ConfettiButton>API
| Prop | Type | Default | Description |
|---|---|---|---|
| x / y | number | — | Origin in viewport px (default: screen centre). |
| count / spread / angle / velocity | number | 120 / 70 / -90 / 900 | Burst shape. |
| colors | string[] | — | Palette. |
| shape | "square" | "circle" | "strip" | "mixed" | "mixed" | Piece shape. |
| gravity | number | 1 | Fall speed multiplier. |
Notes
- No-op under
prefers-reduced-motion.