Party Popper

Confetti celebration effect on click. Wraps any trigger element and fires particles on interaction.

Component

Installation

pnpm dlx shadcn@latest add "https://pulkitxm.com/components/party-popper.json"

Usage

Import

Add the PartyPopper import.

import { PartyPopper } from "@/components/party-popper";

Use

Wrap any clickable element.

<PartyPopper>
  <Button>Celebrate</Button>
</PartyPopper>;

Guidelines

  • Wrap any clickable element (button, icon, div) as children.
  • Particles emit from the center of the trigger element.
  • Respects prefers-reduced-motion; no animation when the user has reduced motion enabled.

Props

All props are optional unless marked required. Use these to customize every aspect of the component.

PropTypeDefaultDescription
childrenReact.ReactNodeThe clickable trigger element.
classNamestringAdditional CSS classes for the trigger wrapper.
particleCountnumber12Number of circular/square particles to emit.
streamerCountnumber4Number of streamer particles to emit.
direction"center" | "up" | "down" | "left" | "right""center"Direction particles fly. "center" spreads in all directions; others aim in a focused cone.
colorsreadonly string[]Array of hex colors for particles. Defaults to a vibrant palette.
particleSizeMinnumber8Minimum particle size in pixels.
particleSizeMaxnumber12Maximum particle size in pixels.
streamerWidthMinnumber25Minimum streamer width in pixels.
streamerWidthMaxnumber35Maximum streamer width in pixels.
streamerHeightMinnumber4Minimum streamer height in pixels.
streamerHeightMaxnumber6Maximum streamer height in pixels.

Examples

Basic

Wrap a button to trigger confetti on click.

import { PartyPopper } from "@/components/party-popper";
import { Button } from "@/components/ui/button";

export function PartyPopperBasic() {
  return (
    <PartyPopper>
      <Button>Celebrate</Button>
    </PartyPopper>
  );
}

Direction

Use the direction prop to aim particles. Options: "center" (default), "up", "down", "left", "right".

import { PartyPopper } from "@/components/party-popper";
import { Button } from "@/components/ui/button";

export function PartyPopperDirectionUp() {
  return (
    <PartyPopper direction="up">
      <Button>🎉 Fire Up</Button>
    </PartyPopper>
  );
}

Made with ❤️ by Pulkit & Cursor :)

© 2026 Pulkit. All rights reserved

DMCA Verified

Last updated: