@tsparticles/particles
| Install | |
|---|---|
npm install @tsparticles/particles |
|
| Latest Version: | 4.4.0 |
| License: | MIT |
| Last Updated: | Oct 23, 2026 |
| Links: | GitHub · npm |
tsParticles Particles Bundle
tsParticles particles bundle to create simple particle effects with a focused API.
Included Packages
- @tsparticles/basic (and all its dependencies)
- @tsparticles/engine
- @tsparticles/plugin-interactivity
- @tsparticles/interaction-particles-collisions
- @tsparticles/interaction-particles-links
Exposed API
The package API is centered on particles.
import { particles } from "@tsparticles/particles";
// Main API
const instance = await particles();
const byId = await particles("canvas-id", options);
const byOptions = await particles(options);
// Extra helpers
await particles.init();
const custom = await particles.create(canvas, options);
console.log(particles.version);
@tsparticles/particles does not expose tsParticles from its main entrypoint.
If you need direct engine APIs, import them from @tsparticles/engine.
Installation
pnpm add @tsparticles/particles
Lazy entrypoint (loads dependencies on demand):
import { particles } from "@tsparticles/particles/lazy";
How to use it
import { particles } from "@tsparticles/particles";
const instance = await particles({
count: 120,
color: "#00f",
links: true,
linksColor: "#0ff",
linksLength: 140,
radius: 4,
shape: ["circle", "square"],
});
instance?.pause();
instance?.play();
instance?.stop();
Custom canvas via particles.create
import { particles } from "@tsparticles/particles";
const canvas = document.getElementById("my-canvas") as HTMLCanvasElement;
await particles.create(canvas, { links: true });
Options
Main options (shallow overview):
countNumber: particles amount (default: 80)radiusNumber or RangeValue: particle radius (default: 3)linksBoolean: enable links between particleslinksLengthNumber: maximum link distancespeedNumber or RangeValue: particle movement speedcollisionsBoolean: enable particle collisionsopacityNumber: particle opacityshapeString or Array<String>: particle shape type(s)colorString: particle colorlinksColorString: link color
Returned instance methods
The resolved ParticlesInstance exposes:
pause()play()stop()
Common pitfalls
- Calling
particlesbefore scripts are loaded in CDN usage - Assuming
tsParticlesis exported by@tsparticles/particlesmain entrypoint - Reusing the same
idunintentionally (the package caches instances by id)
Related docs
- All packages catalog: https://github.com/tsparticles/tsparticles
- Main docs: https://particles.js.org/docs/
Related Packages
tsParticles ribbons bundle — easily create animated ribbons, ribbon bursts and r...
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...
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 |
Pre-releases (4)
| 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 |
