Confetti

Stable

Celebrate with animated confetti particles! 🎉

Import

import { Confetti } from '@brutal-ui/react';

Basic Usage

const [showConfetti, setShowConfetti] = useState(false);

<Button
  onClick={() => {
    setShowConfetti(true);
    setTimeout(() => setShowConfetti(false), 3000);
  }}
>
  Celebrate!
</Button>

{showConfetti && <Confetti active={true} />}

Customization

Control duration, particle count, and animation speed:

<Confetti 
  active={true}
  duration={5000}
  particleCount={150}
/>

Use Cases

✅
Successful Actions

Form submission, account creation, checkout completion

🎯
Achievements

Milestone reached, level up, streak completed

🎊
Special Events

Birthday, anniversary, winning a contest

Props

PropTypeDefaultDescription
activebooleanfalseTrigger confetti animation
durationnumber3000Duration in milliseconds
particleCountnumber100Number of particles