Description
react-confetti is a React component that draws confetti on a canvas for celebrations. It is for developers who want a celebratory effect in a web app without managing the animation themselves, and its README tagline is 'Confetti without the cleanup'. You give it a width and height, which the README recommends setting yourself, because the default dimensions do not respond to window resizing. It can be used with a hook. Its many props control how the confetti behaves. You set the number of pieces, the rectangle the confetti spawns from, friction, wind, gravity and the horizontal and vertical starting velocities, either as a single value or as a range. You can choose colours from a default palette, set opacity, keep spawning after the first batch, pause the animation loop, cap the frame rate, and set how long the confetti takes to appear and which easing function it uses. A drawShape function lets you draw a custom shape for each piece. The project was based on a CodePen by another author, and it is on GitHub at alampros/react-confetti. Use it to add a confetti burst to a success message, a completed form or a milestone in a React interface.…
Highlights
- Canvas confetti for React
- Configurable physics and colours
- Range-based starting velocities
- Custom piece shapes with drawShape
- Can pause, recycle and cap frame rate
Ratings & Reviews
No ratings yet
Be the first to rate react-confetti.
People also visit
glint-ui
354 animated React components you copy, paste and own: text effects, cursors
react-confetti FAQ
What is react-confetti?
A React component that draws confetti on a canvas for celebrations in a web app.
Should I set the size myself?
Yes. The README recommends providing width and height, because the defaults do not respond to resizing.
Can I change how the confetti moves?
Yes. Props set the number of pieces, friction, wind, gravity, starting velocities and easing.
Can I draw my own shapes?
Yes. The drawShape prop lets you draw a custom shape for each piece.
Does it stop by itself?
You can set run to false to stop the loop, and recycle controls whether it keeps spawning confetti.
What are the best react-confetti alternatives?
Popular alternatives to react-confetti include sekei, glint-ui and honestui. See all react-confetti alternatives











