Description
canvas-confetti is a small JavaScript library that creates confetti animations in the browser, drawn on a canvas for good performance. You call a single function with optional settings, and it launches the confetti. The function returns a Promise that resolves when the animation finishes, when promises are available, and returns null in browsers without them. The library can be installed from npm and imported into a build system such as webpack, and it can also be loaded directly in a page from a CDN and called as a global function. Because it is a client component, it does not run in Node. The README includes a reduced motion option, disableForReducedMotion, so sites can turn off the animation for visitors who prefer less motion. It is disabled by default, and the author says a future major version may change that default. A shapeFromPath helper lets you use a custom SVG path as the confetti shape. The project has continuous integration, and its npm and jsDelivr downloads are tracked on its badges. The README includes a live demo on GitHub Pages.…
Highlights
- Canvas-based confetti animation
- Returns a Promise when finished
- Reduced motion option
- Custom shapes from SVG paths
- Install from npm or a CDN
Ratings & Reviews
No ratings yet
Be the first to rate Canvas Confetti.
People also visit
Canvas Confetti FAQ
What is canvas-confetti?
A browser library that draws confetti animations on a canvas.
How do I install it?
Install it from npm and import it into your build, or include it directly in a page from a CDN.
Does it work on the server?
No. The README says it is a client component and will not run in Node.
Can I respect reduced motion?
Yes. Set disableForReducedMotion so the animation is skipped for visitors who prefer reduced motion.
Can I use my own shape?
Yes. shapeFromPath lets you build a shape from an SVG path with an optional matrix.
What does confetti return?
A Promise that resolves when the animation is done, or null in browsers without Promise support.
What are the best Canvas Confetti alternatives?
Popular alternatives to Canvas Confetti include Sparticles, Framer-ground and HypnoticCanvas. See all Canvas Confetti alternatives







