ConfettiButton

A ringed dark button with a sparkle icon that fires a restrained confetti burst on click.

ConfettiButton is a calm, ringed dark button with a small sparkle icon. Click it and it presses in, the sparkle lights up, and a short burst of soft, muted confetti falls from the button β€” a tiny celebration that still looks professional.

Preview

Props

Install

Add the item with the shadcn CLI.

npx shadcn@latest add @evilbuttons/confetti-button

Usage

import { ConfettiButton } from "@/components/evil-buttons/confetti-button";

export function ButtonDemo() {
  return (
    <ConfettiButton
      colors={["#fafafa", "#a3a3a3", "#93c5fd"]}
      onCelebrate={() => console.log("Celebrated!")}
    >
      Celebrate
    </ConfettiButton>
  );
}

Props

The component spreads native button props. onClick still fires before the burst; call event.preventDefault() to skip it.

PropTypeDefaultDescription
childrenReact.ReactNode-Button label. Falls back to label.
labelReact.ReactNode"Continue"Label used when no children are provided.
particleCountnumber80Confetti particles per burst.
spreadnumber64Confetti spread in degrees.
startVelocitynumber32Launch velocity of the burst.
colorsstring[]muted neutrals + soft accentsCustom confetti colors.
iconbooleantrueShow the leading sparkle icon.
onCelebrate() => void-Fired after each confetti burst.
classNamestring-Extra classes merged onto the button.

Notes

  • Shares the graded dark surface, hairline ring, and spring press used by MinimalButton and CommandButton.
  • Each click fires one small burst of flat squares and dots from the button via canvas-confetti, and the sparkle icon flares briefly.
  • Confetti is skipped automatically when the user prefers reduced motion.

Registry

The registry item includes components/evil-buttons/confetti-button.tsx, and adds canvas-confetti, clsx, and tailwind-merge as dependencies.

Search docs

Jump to a button documentation page