@tsparticles/confetti
| Install | |
|---|---|
npm install @tsparticles/confetti |
|
| Latest Version: | 4.4.0 |
| License: | MIT |
| Last Updated: | Oct 21, 2026 |
| Links: | GitHub · npm |
tsParticles Confetti Bundle
tsParticles confetti bundle to create confetti effects with a single API.
Included Packages
- @tsparticles/basic (and all its dependencies)
- @tsparticles/engine
- @tsparticles/plugin-emitters
- @tsparticles/plugin-motion
- @tsparticles/shape-cards
- @tsparticles/shape-emoji
- @tsparticles/shape-heart
- @tsparticles/shape-image
- @tsparticles/shape-polygon
- @tsparticles/shape-square
- @tsparticles/shape-star
- @tsparticles/updater-life
- @tsparticles/updater-roll
- @tsparticles/updater-rotate
- @tsparticles/updater-tilt
- @tsparticles/updater-wobble
Dependency Graph
flowchart TD
subgraph b [Bundle]
bc[tsparticles/confetti]
bb[tsparticles/basic]
end
subgraph c [Core]
ce[tsparticles/engine]
end
subgraph p [Plugins]
pe[tsparticles/plugin-emitters]
pm[tsparticles/plugin-motion]
end
subgraph s [Shapes]
sca[tsparticles/shape-cards]
se[tsparticles/shape-emoji]
sh[tsparticles/shape-heart]
si[tsparticles/shape-image]
sp[tsparticles/shape-polygon]
ss[tsparticles/shape-square]
sst[tsparticles/shape-star]
end
subgraph u [Updaters]
ul[tsparticles/updater-life]
ur[tsparticles/updater-roll]
uro[tsparticles/updater-rotate]
ut[tsparticles/updater-tilt]
uw[tsparticles/updater-wobble]
end
bc --> bb
bc --> ce
bc --> p
bc --> s
bc --> u
Exposed API
The package API is centered on confetti.
import { confetti } from "@tsparticles/confetti";
// Main API
await confetti(options);
await confetti("canvas-id", options);
// Extra helpers
await confetti.init();
const fireOnCanvas = await confetti.create(canvas, defaultOptions);
await fireOnCanvas(options);
console.log(confetti.version);
@tsparticles/confetti does not expose tsParticles from its main entrypoint.
If you need direct engine APIs, import them from @tsparticles/engine.
Installation
pnpm add @tsparticles/confetti
How to use it
ESM / TypeScript
import { confetti } from "@tsparticles/confetti";
await confetti({
count: 80,
spread: 60,
position: { x: 50, y: 50 },
colors: ["#ffffff", "#ff0000"],
});
With explicit canvas id:
import { confetti } from "@tsparticles/confetti";
await confetti("tsparticles", {
count: 50,
angle: 90,
spread: 45,
});
Custom canvas via confetti.create
import { confetti } from "@tsparticles/confetti";
const canvas = document.getElementById("my-canvas") as HTMLCanvasElement;
const localConfetti = await confetti.create(canvas, { count: 30 });
await localConfetti({ spread: 70 });
CDN / Vanilla JS / jQuery
The CDN/Vanilla JS version has two files:
- One is a bundle file with all the scripts included in a single file
- One includes only the
confettiAPI, where dependencies must be loaded manually
After loading the bundle, confetti is available on globalThis.
Bundle
Use the bundle when you want a single script with all required dependencies.
Not Bundle
This installation requires more work since all dependencies must be included in the page. Some lines above are all specified in the Included Packages section.
Usage
confetti({ count: 60 });
(async () => {
await confetti({ count: 60, spread: 55 });
})();
confetti("tsparticles", {
count: 50,
position: {
x: 50,
y: 50,
},
});
Options
The confetti API accepts:
confetti(options)confetti(id, options)
Main options:
countInteger (default: 50)angleNumber (default: 90)spreadNumber (default: 45)startVelocityNumber (default: 45)decayNumber (default: 0.9)flatBoolean (default: false)gravityNumber (default: 1)driftNumber (default: 0)ticksNumber (default: 200)positionObject (x/y, default 50/50)colorsArray<String>shapesArray<String>shapeOptionsRecord<string, unknown>scalarNumber (default: 1)zIndexInteger (default: 100)disableForReducedMotionBoolean (default: true)
Deprecated aliases still accepted:
particleCount(usecount)origin(useposition)
Common pitfalls
- Calling
confettibefore scripts are loaded in CDN usage - Assuming
tsParticlesis exported by@tsparticles/confettimain entrypoint - Passing no first argument in TypeScript (use
confetti(options)orconfetti(id, options))
Related docs
- All packages catalog: https://github.com/tsparticles/tsparticles
- Main docs: https://particles.js.org/docs/
Related Packages
Easily create highly customizable particle, confetti and fireworks animations an...
Basic tsParticles bundle — minimal core engine with only the essential features...
Slim tsParticles bundle — core engine with essential plugins, presets, and inter...
Full-featured tsParticles bundle — create stunning particle, confetti and firewo...
Official tsParticles Vue.js 3.x Component - Easily create highly customizable pa...
Version History
| Version | Released | License |
|---|---|---|
| 4.4.0 | MIT | |
| 4.3.2 | MIT | |
| 4.3.1 | MIT | |
| 4.3.0 | MIT | |
| 4.2.1 | MIT | |
| 4.2.0 | MIT | |
| 4.1.3 | MIT | |
| 4.1.2 | MIT | |
| 4.1.1 | MIT | |
| 4.1.0 | MIT | |
| 4.0.5 | MIT | |
| 4.0.4 | MIT | |
| 4.0.3 | MIT | |
| 4.0.2 | MIT | |
| 4.0.1 | MIT | |
| 4.0.0 | MIT | |
| 3.9.1 | MIT | |
| 3.9.0 | MIT | |
| 3.8.1 | MIT | |
| 3.8.0 | MIT | |
| 3.7.1 | MIT | |
| 3.7.0 | MIT | |
| 3.6.0 | MIT | |
| 3.5.0 | MIT | |
| 3.4.0 | MIT | |
| 3.3.0 | MIT | |
| 3.2.2 | MIT | |
| 3.2.1 | MIT | |
| 3.2.0 | MIT | |
| 3.1.0 | MIT |
Showing the latest 30 of 34. See every release on npm
Pre-releases (44)
| Version | Released | License |
|---|---|---|
| 4.0.0-beta.17 | MIT | |
| 4.0.0-beta.16 | MIT | |
| 4.0.0-beta.15 | MIT | |
| 4.0.0-beta.12 | MIT | |
| 4.0.0-beta.11 | MIT | |
| 4.0.0-beta.10 | MIT | |
| 4.0.0-beta.9 | MIT | |
| 4.0.0-beta.8 | MIT | |
| 4.0.0-beta.6 | MIT | |
| 4.0.0-beta.5 | MIT | |
| 4.0.0-beta.4 | MIT | |
| 4.0.0-beta.3 | MIT | |
| 4.0.0-beta.2 | MIT | |
| 4.0.0-beta.1 | MIT | |
| 4.0.0-beta.0 | MIT | |
| 4.0.0-alpha.28 | MIT | |
| 4.0.0-alpha.27 | MIT | |
| 4.0.0-alpha.26 | MIT | |
| 4.0.0-alpha.25 | MIT | |
| 4.0.0-alpha.24 | MIT | |
| 4.0.0-alpha.23 | MIT | |
| 4.0.0-alpha.22 | MIT | |
| 4.0.0-alpha.21 | MIT | |
| 4.0.0-alpha.20 | MIT | |
| 4.0.0-alpha.18 | MIT | |
| 4.0.0-alpha.17 | MIT | |
| 4.0.0-alpha.16 | MIT | |
| 4.0.0-alpha.15 | MIT | |
| 4.0.0-alpha.14 | MIT | |
| 4.0.0-alpha.8 | MIT |
Showing the latest 30 of 44. See every release on npm
