OPUS/UI

Navigation

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.json

Or offline, straight from your opus55 checkout (copies every file it needs):

node ../tailwind_component/opus55/scripts/add.mjs confetti

Usage

import { confetti, ConfettiButton } from "@/components/opus/effects/confetti";

confetti({ x: 200, y: 300, spread: 90 });
<ConfettiButton>Celebrate</ConfettiButton>

API

PropTypeDefaultDescription
x / ynumber—Origin in viewport px (default: screen centre).
count / spread / angle / velocitynumber120 / 70 / -90 / 900Burst shape.
colorsstring[]—Palette.
shape"square" | "circle" | "strip" | "mixed""mixed"Piece shape.
gravitynumber1Fall speed multiplier.

Notes

  • No-op under prefers-reduced-motion.

Command palette