ConfettiButton

Get this button for GPUI

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

Preview

Props

Install

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.

Good to know

  • Confetti comes from canvas-confetti.
  • Skipped under prefers-reduced-motion.

Search docs

Jump to a button documentation page