Ballmac UI home

Confetti

Confetti in your theme colors: fireConfetti(), a useConfetti() hook that fires from an element, and a ConfettiButton. Presets for burst, side cannons, stars and fireworks; nothing fires under reduced motion.

acme-web

main · 8f3c2a1

Ready to ship 3 commits to production.

Installation

$ pnpm dlx shadcn@latest add @ballmac/confetti

Usage

import { ConfettiButton, fireConfetti, useConfetti } from "@/components/ballmac/confetti"

The full example is in the Code tab above.

Examples

Presets

API reference

PropTypeDefault
options

Confetti options; the burst starts from the button unless `origin` is set.

Omit<FireConfettiOptions, "element">—

Also accepts the standard attributes of its root element.

Use with AI

Call fireConfetti({ preset, colors, element }) from an event handler, or useConfetti().fireFrom(buttonRef.current) after an async success. <ConfettiButton options={{ preset: "stars" }}> is a Ballmac button that bursts from itself on click. Colors default to --chart-1…5. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Confetti (@ballmac/confetti) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Rewarding a finished milestone: first deploy, upgrade, completed onboarding
  • Success states after a long async action
  • Playful marketing buttons (sparingly)

Not for

  • Routine actions such as saving a form (use a toast or inline check)
  • As the only success signal; always show a text confirmation too

Registry JSON: https://ui.ballmac.com/r/confetti.json

Credits

Free to use in personal and commercial projects.