Skip to content

Plugins & Customization

tsParticles can be extended at runtime with custom shapes, presets, plugins, and more. You can either create extensions inline (app-local) or build full npm packages using the CLI scaffolding tool.

Quick decision map

  • Use a custom shape when you only need a new drawing primitive.
  • Use a custom preset when you want to reuse one full options object.
  • Use a plugin when you need runtime logic (container lifecycle, custom behavior, option parsing).

All extension types at a glance

TypeWhat it doesHow to use
PluginContainer/runtime feature module (emitters, absorbers, polygon mask)Enable with your plugin options and lifecycle hooks
ShapeParticle drawing primitive (particles.shape.type)Set particles.shape.type to your shape id
PresetReusable full options profile (preset)Set root preset
UpdaterPer-frame particle property updater (tilt, roll, opacity, size)Runs automatically where isEnabled returns true
EffectParticle rendering effect (particles.effect)Set particles.effect.type to your effect id
InteractionBehavior between particles and events (mouse/touch or particle-particle)Enable in interactivity.events / optional custom mode checks
PathMotion path generator for particle movement (particles.move.path)Set particles.move.path.generator to your path id
PaletteReusable style/colors profile (particles.palette)Set particles.palette to your palette id
Custom BundleGrouped loader that registers many features at onceCall await loadMyBundle(tsParticles) before tsParticles.load(...)

Composition strategy

  • Start from one bundle (slim is usually enough).
  • Add missing capabilities as small focused modules (interaction/updater/path/effect/shape).
  • Use preset for behavior reuse and palette for visual identity reuse.
  • Keep app-local custom extensions first, publish only when reused across projects.

Practical rules

  • Keep extension names unique (for example app-* or company prefix).
  • Start app-local, extract to a package only when reused in multiple projects.
  • Keep a tiny config fixture while developing (faster regressions checks).
  • If a feature is missing, verify the required package is loaded (shape, interaction, updater, plugin).

Next steps

Choose an extension type above for step-by-step guides with inline code and package creation instructions.