Skip to content

Wrappers

This page is the wrappers hub. Use it to choose the right package, then open the dedicated page for installation and usage details.

Source folder: https://github.com/tsparticles/tsparticles/tree/main/wrappers

Wrapper pages

React ecosystem

Vue ecosystem

Others (alphabetical)

Common integration flow

No matter the framework:

  1. install wrapper + @tsparticles/engine
  2. load features once (@tsparticles/slim, @tsparticles/all, or custom plugins)
  3. render the wrapper component with options

Official wrappers (alphabetical)

Ordering rule for this section:

WordPress and Elementor notes

Wrapper to demo mapping

Use this quick matrix to jump from a wrapper package to a runnable monorepo demo.

Ordering rule for this table:

  • alphabetical by wrapper package name
  • explicit exception for wrappers that are not demo-applicable (@tsparticles/wordpress)

Source demos folder: https://github.com/tsparticles/tsparticles/tree/main/demo

Wrapper packageDemo project
@tsparticles/angulardemo/angular
@tsparticles/astrodemo/astro
@tsparticles/emberdemo/ember
@tsparticles/infernodemo/inferno
@tsparticles/jquerydemo/jquery
@tsparticles/litdemo/lit
@tsparticles/nextjsdemo/nextjs, demo/nextjs-legacy
@tsparticles/nuxt2demo/nuxt2
@tsparticles/nuxt3demo/nuxt3
@tsparticles/nuxt4demo/nuxt4
@tsparticles/preactdemo/preact
@tsparticles/qwikdemo/qwik
@tsparticles/reactdemo/react
@tsparticles/riotdemo/riot
@tsparticles/soliddemo/solid
@tsparticles/sveltedemo/svelte, demo/svelte-kit
@tsparticles/vue2demo/vue2
@tsparticles/vue3demo/vue3
@tsparticles/webcomponentsdemo/webcomponents
@tsparticles/wordpressnot applicable (requires full WordPress installation)
angular-confettidemo/angular
angular-fireworksdemo/angular

Minimal patterns

React / Next.js-style provider

tsx
import Particles, { ParticlesProvider } from "@tsparticles/react";
import type { Engine } from "@tsparticles/engine";
import { loadSlim } from "@tsparticles/slim";

const init = async (engine: Engine): Promise<void> => {
  await loadSlim(engine);
};

export function Background() {
  return (
    <ParticlesProvider init={init}>
      <Particles id="tsparticles" options={{ particles: { move: { enable: true } } }} />
    </ParticlesProvider>
  );
}

Vue / Nuxt-style register function

ts
import type { Engine } from "@tsparticles/engine";

export async function registerParticles(engine: Engine): Promise<void> {
  const [{ loadSlim }] = await Promise.all([import("@tsparticles/slim")]);

  await loadSlim(engine);
}

Angular one-time initialization

ts
import { NgParticlesService } from "@tsparticles/angular";
import { loadSlim } from "@tsparticles/slim";

constructor(private readonly particlesService: NgParticlesService) {}

ngOnInit(): void {
  void this.particlesService.init(async engine => {
    await loadSlim(engine);
  });
}