Skip to content

Installation

This page mirrors the installation matrix from the main tsParticles README.

Source of truth: https://github.com/tsparticles/tsparticles/blob/main/README.md#library-installation

Choose your path

  • Fast default: @tsparticles/engine + @tsparticles/slim
  • Smaller custom runtime: @tsparticles/engine + only required plugins
  • Focused APIs: @tsparticles/particles, @tsparticles/confetti, or @tsparticles/fireworks
  • All features included: @tsparticles/all

Hosting / CDN

Use one of these providers (or self-host your built files).

jsDelivr

cdnjs

unpkg

Package manager install

npm

bash
npm install @tsparticles/engine

yarn

bash
yarn add @tsparticles/engine

pnpm

bash
pnpm add @tsparticles/engine

Import and require

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

// or

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

Minimal runtime setup (@tsparticles/slim)

ts
import { tsParticles } from "@tsparticles/engine";
import { loadSlim } from "@tsparticles/slim";

await loadSlim(tsParticles);

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

Legacy compatibility

If you are migrating legacy particles.js integrations, use the compatibility package: