Components / Buttons
Confetti Button
A button that bursts into physics-driven confetti when clicked.
Installation
Requires React 18+ and Tailwind CSS.
- 1
Install dependencies
$ npm install motion - 2
Add the component
Copy the code from the Code tab above into
components/ui/confetti-button.tsx. - 3
Use it
example.tsximport { ConfettiButton } from "@/components/ui/confetti-button"; export default function ConfettiButtonDemo() { return <ConfettiButton>🎉 Celebrate</ConfettiButton>; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| colors | string[] | — | Confetti colors. |
| count | number | 90 | Pieces per burst. |
| onClick | (event) => void | — | Click handler, called after the burst starts. |