MCPcopy Index your code
hub / github.com/tsparticles/tsparticles

github.com/tsparticles/tsparticles @v4.3.1 sqlite

repository ↗ · DeepWiki ↗ · release v4.3.1 ↗
5,001 symbols 17,632 edges 3,941 files 840 documented · 17%
README

banner

tsParticles - TypeScript Particles

A lightweight TypeScript library for creating particles. Dependency free (*), browser ready and compatible with React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.js, Solid.js, and Web Components

GitHub Sponsors jsDelivr hits (npm) Cdnjs npm npm CodeFactor Codacy Badge Rate this package Gitpod Ready-to-Code Run on Repl.it

Discord Telegram Reddit

tsParticles Product Hunt Buy Me A Coffee


Table of Contents


Do you want to use it on your website?

Documentation and Development references here 📖

This library is available on two of the most popular CDNs and it's easy and ready to use, if you were using particles.js it's even easier.

You'll find the instructions below, with all the links you need, and don't be scared by TypeScript, it's just the source language.

The output files are just JavaScript. 🤩

CDNs and npm have all the sources you need in Javascript, a bundle browser ready (tsparticles.engine.min.js), and all files splitted for import syntax.

If you are interested there are some simple instructions just below to guide you to migrate from the old particles.js library.

Start here in 2 minutes

If you are new to tsParticles, this path is usually the fastest:

  1. Install @tsparticles/engine and @tsparticles/slim
  2. Load the slim bundle once
  3. Start with a small config and iterate
import { tsParticles } from "@tsparticles/engine";
import { loadSlim } from "@tsparticles/slim";

await loadSlim(tsParticles);

await tsParticles.load({
  id: "tsparticles",
  options: {
    background: {
      color: "#0d1117",
    },
    particles: {
      move: {
        enable: true,
      },
      number: {
        value: 60,
      },
    },
  },
});

Useful docs for the next step:

Quick checklist

  • Install @tsparticles/engine and one bundle (@tsparticles/slim is the common default)
  • Load the bundle before calling tsParticles.load(...)
  • Start from a small config, then extend incrementally

Choose your quick-start path

  • I want fewer dependencies: use @tsparticles/engine + only needed feature packages
  • I want the easiest default: use @tsparticles/slim
  • I need everything enabled: use @tsparticles/all

Common pitfalls

  • Loading options that require plugins before loading those plugin packages
  • Starting with very high particle counts before checking FPS
  • Mixing legacy snake_case keys with modern camelCase options

Related docs

Library installation

Hosting / CDN

Please use these hosts or your own to load tsParticles on your projects

jsDelivr

jsDelivr jsDelivr jsDelivr jsDelivr jsDelivr jsDelivr jsDelivr jsDelivr

cdnjs

Cdnjs

unpkg

https://unpkg.com/@tsparticles/confetti/ https://unpkg.com/@tsparticles/particles/ https://unpkg.com/@tsparticles/engine/ https://unpkg.com/@tsparticles/fireworks/ https://unpkg.com/@tsparticles/basic/ https://unpkg.com/@tsparticles/slim/ https://unpkg.com/tsparticles/ https://unpkg.com/@tsparticles/all/


npm

tsParticles Confetti

npm npmjs

tsParticles Particles

npm npmjs

tsParticles Engine

npm npmjs

tsParticles Fireworks

npm npmjs

tsParticles Basic

npm npmjs

tsParticles Slim

npm npmjs

tsParticles

npm npmjs

tsParticles All

npm npmjs

npm install @tsparticles/engine

yarn

yarn add @tsparticles/engine

pnpm

pnpm install @tsparticles/engine

Import and require

const tsParticles = require("@tsparticles/engine");

// or

import { tsParticles } from "@tsparticles/engine";

The imported tsParticles is the same instance you have when including the script in the page using the <script> tag.


Usage

Load tsParticles and configure the particles:

tsParticles demo tsParticles Confetti demo

index.html







<script src="https://github.com/tsparticles/tsparticles/raw/v4.3.1/tsparticles.engine.min.js"></script>

app.js

```javascript /

Extension points exported contracts — how you extend this code

IOptionLoader (Interface)
(no doc) [129 implementers]
engine/src/Options/Interfaces/IOptionLoader.ts
IMovePathGenerator (Interface)
(no doc) [11 implementers]
plugins/move/src/IMovePathGenerator.ts
IExternalInteractor (Interface)
(no doc) [26 implementers]
plugins/interactivity/src/Interfaces/IExternalInteractor.ts
IEmitterShapeGenerator (Interface)
(no doc) [18 implementers]
plugins/emitters/src/IEmitterShapeGenerator.ts
IOutModeManager (Interface)
(no doc) [38 implementers]
updaters/outModes/src/IOutModeManager.ts
INoiseGenerator (Interface)
(no doc) [3 implementers]
utils/noiseField/src/INoiseGenerator.ts
SVGElementInstanceList (Interface)
Interface value [1 implementers]
plugins/polygonMask/src/pathseg.d.ts
CannonData (Interface)
Cannon mode internal data
interactions/external/cannon/src/Cannoner.ts

Core symbols most depended-on inside this repo

register
called by 715
engine/src/Core/Utils/PluginManager.ts
push
called by 604
engine/src/Core/ParticlesManager.ts
addPalette
called by 388
engine/src/Core/Utils/PluginManager.ts
loadProperty
called by 287
engine/src/Utils/OptionsUtils.ts
checkVersion
called by 286
engine/src/Core/Engine.ts
load
called by 205
bundles/pjs/src/VincentGarreau/IParticlesJS.ts
loadParticlesPalette
called by 193
cli/utils/rollup-plugin/src/index.ts
getRangeValue
called by 160
engine/src/Utils/MathUtils.ts

Shape

Function 1,833
Method 1,631
Class 929
Interface 561
Enum 47

Languages

TypeScript100%
Python1%

Modules by API surface

engine/src/Core/Particle.ts47 symbols
plugins/polygonMask/src/pathseg.d.ts35 symbols
engine/src/Core/RenderManager.ts34 symbols
engine/src/Core/ParticlesManager.ts32 symbols
plugins/sounds/src/SoundsPluginInstance.ts31 symbols
engine/src/Core/Interfaces/Colors.ts30 symbols
engine/src/Utils/MathUtils.ts28 symbols
engine/src/Core/Utils/Vectors.ts28 symbols
engine/src/Utils/ColorUtils.ts27 symbols
engine/src/Core/Container.ts26 symbols
engine/src/Core/Utils/PluginManager.ts25 symbols
engine/src/Core/CanvasManager.ts25 symbols

Dependencies from manifests, versioned

@11ty/eleventy3.1.6 · 1×
@11ty/eleventy-plugin-syntaxhighlight5.0.2 · 1×
@angular-devkit/build-angular22.0.0 · 1×
@angular-eslint/eslint-plugin22.0.0 · 1×
@angular-eslint/eslint-plugin-template22.0.0 · 1×
@angular-eslint/template-parser22.0.0 · 1×
@angular/animations22.0.0 · 1×
@angular/build22.0.4 · 1×
@angular/cli22.0.0 · 1×
@angular/common22.0.0 · 1×
@angular/compiler22.0.0 · 1×

For agents

$ claude mcp add tsparticles \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact