Skip to content

API Reference

The tsParticles API is organized into layers. Use this page to find the right section.

SectionDescription
Full API docs (typedoc)Auto-generated reference for all packages
EngineCore engine — Engine, Container, tsParticles instance
OptionsComplete options interface tree
ContainerRuntime container — play, pause, refresh, export
IPluginPlugin interface for custom extensions

Engine

The @tsparticles/engine package exports the core classes:

  • tsParticles — global singleton instance
  • Engine — the engine class used to create and manage containers
  • Container — a single particle canvas instance
  • load — the main entry point for creating particles

Options

The options object is a plain TypeScript interface. Key nested types:

  • IOptions — root options (background, particles, interactivity, plugins)
  • IParticlesOptions — per-particle options (move, shape, size, color, etc.)
  • IInteractivity — click, hover, and scroll events + modes

Browse the Options Reference or the full Options type.

Container API

The Container class controls a running particle instance:

MethodDescription
play()Resume animation
pause()Stop animation
refresh()Destroy and re-create particles with current options
export(type)Export current frame as image/canvas blob
addListener(event, cb)Subscribe to container events

Plugin System

tsParticles supports custom plugins, shapes, updaters, interactions, and paths.

Bundles

Choose the right import for your project:

BundleIncluded
@tsparticles/basicCore + circle shape + color + size + opacity + move
@tsparticles/slimBasic + interactivity + polygons + images + emoji + stars
tsparticles (full)Slim + absorbers + emitters + trail + sounds + all shapes
@tsparticles/allEverything including ships + fireworks + confetti

Package-level Dependency Graph.

Migration & Versioning