tsParticles is a lightweight TypeScript library for creating particles. Dependency free (*), browser ready and compatible with React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.js, Solid.js, and Web Components.
This is the core engine package that all other features depend on.
@tsparticles/enginetsParticles.load() to apply particle configurationsnpm install @tsparticles/engine
or
yarn add @tsparticles/engine
or
pnpm install @tsparticles/engine
import { tsParticles } from "@tsparticles/engine";
await tsParticles.load({
id: "tsparticles",
options: {
particles: {
number: {
value: 80,
},
move: {
enable: true,
speed: 2,
},
},
},
});
To extend the engine with more capabilities, load additional packages:
import { tsParticles } from "@tsparticles/engine";
import { loadSlim } from "@tsparticles/slim"; // or other bundles
await loadSlim(tsParticles); // Load preset features
await tsParticles.load({
id: "tsparticles",
options: {
// Your configuration here
},
});
tsParticles.load(...) may not work as expected