tsParticles - Easily create highly customizable JavaScript particles effects, confetti explosions and fireworks animations and use them as animated backgrounds
tsParticles - Easily create highly customizable JavaScript particles effects, confetti explosions and fireworks animations and use them as animated backgrounds
_Documentation and Development references here _
This library is available on two of the most popular CDNs and it's easy and ready to use, if you were using particles.js it's even easier.
You'll find the instructions below, with all the links you need, and don't be scared by TypeScript, it's just the source language.
The output files are just JavaScript.
CDNs and npm have all the sources you need in Javascript, a bundle browser ready (tsparticles.engine.min.js), and
all
files splitted for import syntax.
If you are interested there are some simple instructions just below to guide you to migrate from the old particles.js library.
If you are new to tsParticles, this path is usually the fastest:
@tsparticles/engine and @tsparticles/slimimport { tsParticles } from "@tsparticles/engine";
import { loadSlim } from "@tsparticles/slim";
await loadSlim(tsParticles);
await tsParticles.load({
id: "tsparticles",
options: {
background: {
color: "#0d1117",
},
particles: {
move: {
enable: true,
},
number: {
value: 60,
},
},
},
});Useful docs for the next step:
@tsparticles/engine and one bundle (@tsparticles/slim is the common default)tsParticles.load(...)@tsparticles/engine + only needed feature packages@tsparticles/slim@tsparticles/allPlease use these hosts or your own to load tsParticles on your projects
https://unpkg.com/@tsparticles/confetti/ https://unpkg.com/@tsparticles/particles/ https://unpkg.com/@tsparticles/engine/ https://unpkg.com/@tsparticles/fireworks/ https://unpkg.com/@tsparticles/basic/ https://unpkg.com/@tsparticles/slim/ https://unpkg.com/tsparticles/ https://unpkg.com/@tsparticles/all/
npm install @tsparticles/engineyarn add @tsparticles/enginepnpm install @tsparticles/engineconst tsParticles = require("@tsparticles/engine");
// or
import { tsParticles } from "@tsparticles/engine";The imported tsParticles is the same instance you have when including the script in the page using the <script> tag.
Load tsParticles and configure the particles: index.html
<script src="tsparticles.engine.min.js"></script>app.js
…@tsparticles/angularInstructions available here
@tsparticles/astroInstructions available here
@tsparticles/emberInstructions available here
@tsparticles/infernoInstructions available here
@tsparticles/jqueryInstructions available here
@tsparticles/preactInstructions available here
@tsparticles/qwikInstructions available here
@tsparticles/nextjsInstructions available here
@tsparticles/reactInstructions available here
@tsparticles/riotInstructions available here
@tsparticles/solidInstructions available here
@tsparticles/svelteInstructions available here
@tsparticles/nuxt2Instructions available here
@tsparticles/vue2Instructions available here
@tsparticles/nuxt3Instructions available here
@tsparticles/nuxt4Instructions available here
@tsparticles/vue3Instructions available here
@tsparticles/webcomponentsInstructions available here
Dependency Dashboard
Docs site: ad density on documentation pages is hurting readability
Change the onClick event to handle both mouseUp and mouseDown
Fluid output
Improve Touch events support
Add easing functions to particles values animations
Custom Color Transitions
Absorber Split on Click or Size limit reached