npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tsparticles/confetti

v4.0.5

Published

Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.

Readme

banner

tsParticles Confetti Bundle

jsDelivr npmjs npmjs GitHub Sponsors

tsParticles confetti bundle to create confetti effects with a single API.

Included Packages

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 confetti API, 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:

  • count Integer (default: 50)
  • angle Number (default: 90)
  • spread Number (default: 45)
  • startVelocity Number (default: 45)
  • decay Number (default: 0.9)
  • flat Boolean (default: false)
  • gravity Number (default: 1)
  • drift Number (default: 0)
  • ticks Number (default: 200)
  • position Object (x/y, default 50/50)
  • colors Array<String>
  • shapes Array<String>
  • shapeOptions Record<string, unknown>
  • scalar Number (default: 1)
  • zIndex Integer (default: 100)
  • disableForReducedMotion Boolean (default: true)

Deprecated aliases still accepted:

  • particleCount (use count)
  • origin (use position)

Common pitfalls

  • Calling confetti before scripts are loaded in CDN usage
  • Assuming tsParticles is exported by @tsparticles/confetti main entrypoint
  • Passing no first argument in TypeScript (use confetti(options) or confetti(id, options))

Related docs