UNPKG

35.5 kBMarkdownView Raw
1[![banner](https://particles.js.org/images/banner3.png)](https://particles.js.org)
2
3# tsParticles - TypeScript Particles
4
5**A lightweight TypeScript library for creating particles. Dependency free (\*), browser ready and compatible with
6React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.js, Solid.js, and Web Components**
7
8[![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni?style=for-the-badge)](https://github.com/sponsors/matteobruni)
9[![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hm/tsparticles?style=for-the-badge)](https://www.jsdelivr.com/package/npm/tsparticles)
10[![Cdnjs](https://img.shields.io/cdnjs/v/tsparticles-engine?style=for-the-badge)](https://cdnjs.com/libraries/tsparticles)
11[![npm](https://img.shields.io/npm/v/tsparticles-engine?style=for-the-badge)](https://www.npmjs.com/package/tsparticles)
12[![npm](https://img.shields.io/npm/dm/tsparticles?style=for-the-badge)](https://www.npmjs.com/package/tsparticles)
13[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff?style=for-the-badge)](https://lerna.js.org/)
14[![CodeFactor](https://www.codefactor.io/repository/github/matteobruni/tsparticles/badge)](https://www.codefactor.io/repository/github/matteobruni/tsparticles)
15[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b983aaf3461a4c48b1e2eecce1ff1d74)](https://www.codacy.com/manual/ar3s/tsparticles?utm_source=github.com&utm_medium=referral&utm_content=matteobruni/tsparticles&utm_campaign=Badge_Grade)
16[![Rate this package](https://badges.openbase.com/js/rating/tsparticles.svg?style=openbase&token=A9jHQ1nkb6fnCndKM7O2w4hx3OD8PVCuqHtSpw8mMOg=)](https://openbase.com/js/tsparticles?utm_source=embedded&utm_medium=badge&utm_campaign=rating-badge&utm_term=js/tsparticles)
17[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/matteobruni/tsparticles)
18[![Run on Repl.it](https://repl.it/badge/github/matteobruni/tsparticles)](https://repl.it/github/matteobruni/tsparticles)
19
20[![Discord](https://img.shields.io/discord/872061157379301416?label=discord&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/hACwv45Hme)
21[![Slack](https://particles.js.org/images/slack.png)](https://join.slack.com/t/tsparticles/shared_invite/enQtOTcxNTQxNjQ4NzkxLWE2MTZhZWExMWRmOWI5MTMxNjczOGE1Yjk0MjViYjdkYTUzODM3OTc5MGQ5MjFlODc4MzE0N2Q1OWQxZDc1YzI)
22[![WhatsApp](https://particles.js.org/images/WhatsApp.png)](https://chat.whatsapp.com/KQyHc9UEbRc2qlqNQR2J5c)
23[![Telegram](https://particles.js.org/images/telegram.png)](https://t.me/tsparticles)
24[![Reddit](https://img.shields.io/reddit/subreddit-subscribers/tsParticles?style=for-the-badge)](https://www.reddit.com/r/tsParticles/)
25
26[![tsParticles Product Hunt](https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=186113&theme=light)](https://www.producthunt.com/posts/tsparticles?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-tsparticles")
27[![Buy Me A Coffee](https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20beer&emoji=🍺&slug=matteobruni&button_colour=5F7FFF&font_colour=ffffff&font_family=Arial&outline_colour=000000&coffee_colour=FFDD00")](https://www.buymeacoffee.com/matteobruni)
28
29---
30
31## Table of Contents
32
33- [tsParticles - TypeScript Particles](#tsparticles---typescript-particles)
34 - [Table of Contents](#table-of-contents)
35 - [Do you want to use it on your website?](#do-you-want-to-use-it-on-your-website)
36 - [**_Library installation_**](#library-installation)
37 - [**_Hosting / CDN_**](#hosting--cdn)
38 - [jsDelivr](#jsdelivr)
39 - [cdnjs](#cdnjs)
40 - [unpkg](#unpkg)
41 - [**_npm_**](#npm)
42 - [**_yarn_**](#yarn)
43 - [**_pnpm_**](#pnpm)
44 - [Import and require](#import-and-require)
45 - [**_Usage_**](#usage)
46 - [Official components for some of the most used frameworks](#official-components-for-some-of-the-most-used-frameworks)
47 - [Angular](#angular)
48 - [`ng-particles`](#ng-particles)
49 - [Astro](#astro)
50 - [`astro-particles`](#astro-particles)
51 - [Ember.js](#emberjs)
52 - [`ember-tsparticles`](#ember-tsparticles)
53 - [Inferno](#inferno)
54 - [`inferno-particles`](#inferno-particles)
55 - [jQuery](#jquery)
56 - [`jquery-particles`](#jquery-particles)
57 - [Preact](#preact)
58 - [`preact-particles`](#preact-particles)
59 - [ReactJS](#reactjs)
60 - [`react-particles`](#react-particles)
61 - [RiotJS](#riotjs)
62 - [`riot-particles`](#riot-particles)
63 - [SolidJS](#solidjs)
64 - [`solid-particles`](#solid-particles)
65 - [Svelte](#svelte)
66 - [`svelte-particles`](#svelte-particles)
67 - [VueJS 2.x](#vuejs-2x)
68 - [`vue2-particles`](#vue2-particles)
69 - [VueJS 3.x](#vuejs-3x)
70 - [`vue3-particles`](#vue3-particles)
71 - [Web Components](#web-components)
72 - [`web-particles`](#web-particles)
73 - [WordPress](#wordpress)
74 - [`wordpress-particles`](#wordpress-particles)
75 - [Elementor](#elementor)
76 - [Presets](#presets)
77 - [Big Circles](#big-circles)
78 - [Bubbles](#bubbles)
79 - [Confetti](#confetti)
80 - [Fire](#fire)
81 - [Firefly](#firefly)
82 - [Fireworks](#fireworks)
83 - [Fountain](#fountain)
84 - [Links](#links)
85 - [Sea Anemone](#sea-anemone)
86 - [Snow](#snow)
87 - [Stars](#stars)
88 - [Triangles](#triangles)
89 - [Templates and Resources](#templates-and-resources)
90 - [**_Demo / Generator_**](#demo--generator)
91 - [**_Video Tutorials_**](#video-tutorials)
92 - [Characters as particles](#characters-as-particles)
93 - [Polygon mask](#polygon-mask)
94 - [Animated stars](#animated-stars)
95 - [Nyan cat flying on scrolling stars](#nyan-cat-flying-on-scrolling-stars)
96 - [Snow particles](#snow-particles)
97 - [Background Mask particles](#background-mask-particles)
98 - [**_Options_**](#options)
99 - [Want to see it in action and try it?](#want-to-see-it-in-action-and-try-it)
100 - [Migrating from Particles.js](#migrating-from-particlesjs)
101 - [Plugins/Customizations](#pluginscustomizations)
102 - [Dependency Graph](#dependency-graph)
103 - [Sponsors](#sponsors)
104 - [Huge thanks to JetBrains for the 2020-2022 Open Source Licenses!](#huge-thanks-to-jetbrains-for-the-2020-2022-open-source-licenses)
105
106---
107
108## Do you want to use it on your website?
109
110_Documentation and Development references [here](https://particles.js.org/docs/) 📖_
111
112**This library is available on two of the most popular CDNs and it's easy and ready to use, if you were using
113particles.js
114it's even easier**.
115
116You'll find the
117instructions [below](https://github.com/matteobruni/tsparticles/blob/main/README.md#library-installation), with all the
118links you need, and _don't be scared by **TypeScript**, it's just the source language_.
119
120**The output files are just JavaScript**. 🤩
121
122CDNs and `npm` have all the sources you need in **Javascript**, a bundle browser ready (tsparticles.engine.min.js), and
123all
124files splitted for `import` syntax.
125
126**If you are interested** there are some _simple instructions_
127just [below](https://github.com/matteobruni/tsparticles/blob/main/README.md#library-installation) to guide you to
128migrate from the old particles.js library.
129
130## **_Library installation_**
131
132### **_Hosting / CDN_**
133
134**_Please use these hosts or your own to load tsParticles on your projects_**
135
136#### jsDelivr
137
138[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-confetti/badge)](https://www.jsdelivr.com/package/npm/tsparticles-confetti)
139[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-engine/badge)](https://www.jsdelivr.com/package/npm/tsparticles-engine)
140[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-fireworks/badge)](https://www.jsdelivr.com/package/npm/tsparticles-fireworks)
141[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-basic/badge)](https://www.jsdelivr.com/package/npm/tsparticles-basic)
142[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-slim/badge)](https://www.jsdelivr.com/package/npm/tsparticles-slim)
143[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles/badge)](https://www.jsdelivr.com/package/npm/tsparticles)
144[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-all/badge)](https://www.jsdelivr.com/package/npm/tsparticles-all)
145
146#### cdnjs
147
148[![Cdnjs](https://img.shields.io/cdnjs/v/tsparticles)](https://cdnjs.com/libraries/tsparticles)
149
150#### unpkg
151
152<https://unpkg.com/tsparticles-confetti/> <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/>
153
154---
155
156### **_npm_**
157
158_tsParticles Confetti_
159
160[![npm](https://img.shields.io/npm/v/tsparticles-confetti?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-confetti) [![npmjs](https://img.shields.io/npm/dt/tsparticles-confetti?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-confetti)
161
162_tsParticles Engine_
163
164[![npm](https://img.shields.io/npm/v/tsparticles-engine?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-engine) [![npmjs](https://img.shields.io/npm/dt/tsparticles-engine?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-engine)
165
166_tsParticles Fireworks_
167
168[![npm](https://img.shields.io/npm/v/tsparticles-fireworks?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-fireworks) [![npmjs](https://img.shields.io/npm/dt/tsparticles-fireworks?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-fireworks)
169
170_tsParticles Basic_
171
172[![npm](https://img.shields.io/npm/v/tsparticles-basic?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-basic) [![npmjs](https://img.shields.io/npm/dt/tsparticles-basic?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-basic)
173
174_tsParticles Slim_
175
176[![npm](https://img.shields.io/npm/v/tsparticles-slim?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-slim) [![npmjs](https://img.shields.io/npm/dt/tsparticles-slim?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-slim)
177
178_tsParticles_
179
180[![npm](https://img.shields.io/npm/v/tsparticles?style=for-the-badge)](https://www.npmjs.com/package/tsparticles) [![npmjs](https://img.shields.io/npm/dt/tsparticles?style=for-the-badge)](https://www.npmjs.com/package/tsparticles)
181
182_tsParticles All_
183
184[![npm](https://img.shields.io/npm/v/tsparticles-all?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-all) [![npmjs](https://img.shields.io/npm/dt/tsparticles-all?style=for-the-badge)](https://www.npmjs.com/package/tsparticles-all)
185
186```shell
187npm install tsparticles-engine
188```
189
190### **_yarn_**
191
192```shell
193yarn add tsparticles-engine
194```
195
196### **_pnpm_**
197
198```shell
199pnpm install tsparticles-engine
200```
201
202#### Import and require
203
204```javascript
205const tsParticles = require("tsparticles-engine");
206
207// or
208
209import { tsParticles } from "tsparticles-engine";
210```
211
212The imported `tsParticles` is the same instance you have when including the script in the page using the `<script>` tag.
213
214---
215
216### **_Usage_**
217
218Load tsParticles and configure the particles:
219
220[![tsParticles demo](https://media.giphy.com/media/ftHwBpp3b0qNyCXRuu/giphy.gif)](https://particles.js.org)
221[![tsParticles Confetti demo](https://media.giphy.com/media/ftHwBpp3b0qNyCXRuu/giphy.gif)](https://confetti.js.org)
222
223**index.html**
224
225```html
226<div id="tsparticles"></div>
227
228<script src="tsparticles.engine.min.js"></script>
229```
230
231**app.js**
232
233```javascript
234// @path-json can be an object or an array, the first will be loaded directly, and the object from the array will be randomly selected
235/* tsParticles.load(@params); */
236
237tsParticles
238 .load({
239 id: "tsparticles",
240 url: "presets/default.json",
241 })
242 .then((container) => {
243 console.log("callback - tsparticles config loaded");
244 })
245 .catch((error) => {
246 console.error(error);
247 });
248
249//or
250
251tsParticles.load({
252 id: "tsparticles",
253 options: {
254 /* options here */
255 },
256});
257
258//or
259
260tsParticles.load({
261 id: "tsparticles",
262 options: [
263 {
264 /* options here */
265 },
266 {
267 /* other options here */
268 },
269 ],
270});
271//random object
272
273tsParticles.load({
274 id: "tsparticles",
275 options: [
276 {
277 /* options here */
278 },
279 {
280 /* other options here */
281 },
282 ],
283 index: 1,
284}); //the second one
285// Important! If the index is not in range 0...<array.length, the index will be ignored.
286
287// after initialization this can be used.
288
289/* tsParticles.setOnClickHandler(@callback); */
290
291/* this will be fired from all particles loaded */
292
293tsParticles.setOnClickHandler((event, particles) => {
294 /* custom on click handler */
295});
296
297// now you can control the animations too, it's possible to pause and resume the animations
298// these methods don't change the config so you're safe with all your configurations
299// domItem(0) returns the first tsParticles instance loaded in the dom
300const particles = tsParticles.domItem(0);
301
302// play will start the animations, if the move is not enabled it won't enable it, it just updates the frame
303particles.play();
304
305// pause will stop the animations
306particles.pause();
307```
308
309---
310
311## Official components for some of the most used frameworks
312
313### Angular
314
315#### `ng-particles`
316
317[![npm](https://img.shields.io/npm/v/ng-particles?style=for-the-badge)](https://www.npmjs.com/package/ng-particles) [![npm](https://img.shields.io/npm/dm/ng-particles?style=for-the-badge)](https://www.npmjs.com/package/ng-particles)
318
319Instructions available [here](https://github.com/tsparticles/angular/#readme)
320
321### Astro
322
323#### `astro-particles`
324
325[![npm](https://img.shields.io/npm/v/astro-particles?style=for-the-badge)](https://www.npmjs.com/package/astro-particles) [![npm](https://img.shields.io/npm/dm/astro-particles?style=for-the-badge)](https://www.npmjs.com/package/astro-particles)
326
327Instructions available [here](https://github.com/tsparticles/astro/#readme)
328
329### Ember.js
330
331#### `ember-tsparticles`
332
333[![npm](https://img.shields.io/npm/v/ember-tsparticles?style=for-the-badge)](https://www.npmjs.com/package/ember-tsparticles) [![npm](https://img.shields.io/npm/dm/ember-tsparticles?style=for-the-badge)](https://www.npmjs.com/package/ember-tsparticles)
334
335Instructions available [here](https://github.com/tsparticles/ember/#readme)
336
337### Inferno
338
339#### `inferno-particles`
340
341[![npm](https://img.shields.io/npm/v/inferno-particles?style=for-the-badge)](https://www.npmjs.com/package/inferno-particles) [![npm](https://img.shields.io/npm/dm/inferno-particles?style=for-the-badge)](https://www.npmjs.com/package/inferno-particles)
342
343Instructions available [here](https://github.com/tsparticles/inferno/#readme)
344
345### jQuery
346
347#### `jquery-particles`
348
349[![npm](https://img.shields.io/npm/v/jquery-particles?style=for-the-badge)](https://www.npmjs.com/package/jquery-particles) [![npm](https://img.shields.io/npm/dm/jquery-particles?style=for-the-badge)](https://www.npmjs.com/package/jquery-particles)
350
351Instructions available [here](https://github.com/tsparticles/jquery/#readme)
352
353### Preact
354
355#### `preact-particles`
356
357[![npm](https://img.shields.io/npm/v/preact-particles?style=for-the-badge)](https://www.npmjs.com/package/preact-particles) [![npm](https://img.shields.io/npm/dm/preact-particles?style=for-the-badge)](https://www.npmjs.com/package/preact-particles)
358
359Instructions available [here](https://github.com/tsparticles/preact/#readme)
360
361### ReactJS
362
363#### `react-particles`
364
365[![npm](https://img.shields.io/npm/v/react-particles?style=for-the-badge)](https://www.npmjs.com/package/react-particles) [![npm](https://img.shields.io/npm/dm/react-particles?style=for-the-badge)](https://www.npmjs.com/package/react-particles)
366
367Instructions available [here](https://github.com/tsparticles/react/#readme)
368
369### RiotJS
370
371#### `riot-particles`
372
373[![npm](https://img.shields.io/npm/v/riot-particles?style=for-the-badge)](https://www.npmjs.com/package/riot-particles) [![npm](https://img.shields.io/npm/dm/riot-particles?style=for-the-badge)](https://www.npmjs.com/package/riot-particles)
374
375You can find the instructions [here](https://github.com/tsparticles/riot/#readme)
376
377### SolidJS
378
379#### `solid-particles`
380
381[![npm](https://img.shields.io/npm/v/solid-particles?style=for-the-badge)](https://www.npmjs.com/package/solid-particles) [![npm](https://img.shields.io/npm/dm/solid-particles?style=for-the-badge)](https://www.npmjs.com/package/solid-particles)
382
383You can find the instructions [here](https://github.com/tsparticles/solid/#readme)
384
385### Svelte
386
387#### `svelte-particles`
388
389[![npm](https://img.shields.io/npm/v/svelte-particles?style=for-the-badge)](https://www.npmjs.com/package/svelte-particles) [![npm downloads](https://img.shields.io/npm/dm/svelte-particles?style=for-the-badge)](https://www.npmjs.com/package/svelte-particles)
390
391Instructions available [here](https://github.com/tsparticles/svelte/#readme)
392
393### VueJS 2.x
394
395#### `vue2-particles`
396
397[![npm](https://img.shields.io/npm/v/vue2-particles?style=for-the-badge)](https://www.npmjs.com/package/vue2-particles) [![npm](https://img.shields.io/npm/dm/vue2-particles?style=for-the-badge)](https://www.npmjs.com/package/vue2-particles)
398
399Instructions available [here](https://github.com/tsparticles/vue2/#readme)
400
401### VueJS 3.x
402
403#### `vue3-particles`
404
405[![npm](https://img.shields.io/npm/v/vue3-particles?style=for-the-badge)](https://www.npmjs.com/package/vue3-particles) [![npm](https://img.shields.io/npm/dm/vue3-particles?style=for-the-badge)](https://www.npmjs.com/package/vue3-particles)
406
407Instruction available [here](https://github.com/tsparticles/vue3/#readme)
408
409### Web Components
410
411#### `web-particles`
412
413[![npm](https://img.shields.io/npm/v/web-particles?style=for-the-badge)](https://www.npmjs.com/package/web-particles) [![npm](https://img.shields.io/npm/dm/web-particles?style=for-the-badge)](https://www.npmjs.com/package/web-particles)
414
415You can find the instructions [here](https://github.com/tsparticles/webcomponents/#readme)
416
417### WordPress
418
419#### `wordpress-particles`
420
421[![npm](https://img.shields.io/npm/v/wordpress-particles?style=for-the-badge)](https://www.npmjs.com/package/wordpress-particles) [![npm](https://img.shields.io/npm/dm/wordpress-particles?style=for-the-badge)](https://www.npmjs.com/package/wordpress-particles) [![WordPress Plugin Downloads](https://img.shields.io/wordpress/plugin/dw/tsparticles-block?style=for-the-badge)](https://wordpress.org/plugins/tsparticles-block/) [![WordPress Plugin Active Installs](https://img.shields.io/wordpress/plugin/installs/tsparticles-block?style=for-the-badge)](https://wordpress.org/plugins/tsparticles-block/)
422
423The plugin page hosted on WordPress.org can be
424found [here](https://wordpress.org/plugins/tsparticles-block/#description)
425
426### Elementor
427
428Actually, an official tsParticles plugin isn't existing, but I have a collaboration with
429the `Premium Addons for Elementor` plugin collection.
430
431<div style="float: left; margin-right: 10px;">
432 <img width="64" alt="Premium Addons for Elementor" src="https://particles.js.org/images/premium-addons-wordpress-plugin.png" />
433</div>
434<div>
435 Premium Addons for Elementor is one of the most common plugins for Elementor that offers more than 55 highly customizable Elementor Widgets and Section Add-ons. tsParticles is exclusively included in Premium Particles Section Add-on for Elementor Page Builder. <a href="https://premiumaddons.com/particles-section-addon-for-elementor-page-builder/" target="_blank">Check It Now</a>.<br />
436 Use Premium Addons for Elementor Page Builder and get the chance to include tsParticles in your next WordPress website without the need to write a single line of code. <a href="https://premiumaddons.com/particles-section-addon-for-elementor-page-builder/" target="_blank">See a Live Example</a>.
437</div>
438<div style="clear: both;"></div>
439
440---
441
442## Presets
443
444There are some presets ready to be used in [this repository](https://github.com/tsparticles/presets), and they also have a bundle file that contains everything
445needed to run.
446
447### Big Circles
448
449[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-big-circles/badge)](https://www.jsdelivr.com/package/npm/tsparticles-preset-big-circles) [![npmjs](https://badge.fury.io/js/tsparticles-preset-big-circles.svg)](https://www.npmjs.com/package/tsparticles-preset-big-circles) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-big-circles)](https://www.npmjs.com/package/tsparticles-preset-big-circles)
450
451This preset loads big colored circles moving upwards on a white background.
452
453[![demo](https://github.com/tsparticles/presets/raw/main/presets/bigCircles/images/sample.png)](https://particles.js.org/samples/presets/bigCircles)
454
455You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/bigCircles#readme)
456
457### Bubbles
458
459[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-bubbles/badge)](https://www.jsdelivr.com/package/npm/tsparticles) [![npmjs](https://badge.fury.io/js/tsparticles-preset-bubbles.svg)](https://www.npmjs.com/package/tsparticles-preset-bubbles) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-bubbles)](https://www.npmjs.com/package/tsparticles-preset-bubbles)
460
461This preset loads colored bubbles coming from the bottom of the screen on a white background.
462
463[![demo](https://github.com/tsparticles/presets/raw/main/presets/bubbles/images/sample.png)](https://particles.js.org/samples/presets/bubbles)
464
465You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/bubbles#readme)
466
467### Confetti
468
469[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-confetti/badge)](https://www.jsdelivr.com/package/npm/tsparticles-preset-confetti) [![npmjs](https://badge.fury.io/js/tsparticles-preset-confetti.svg)](https://www.npmjs.com/package/tsparticles-preset-confetti) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-confetti)](https://www.npmjs.com/package/tsparticles-preset-confetti)
470
471This preset loads white and red confetti launched from the screen center on a transparent background.
472
473[![demo](https://github.com/tsparticles/presets/raw/main/presets/confetti/images/sample.png)](https://particles.js.org/samples/presets/confetti)
474
475You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/confetti#readme)
476
477### Fire
478
479[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-fire/badge)](https://www.jsdelivr.com/package/npm/tsparticles-preset-fire) [![npmjs](https://badge.fury.io/js/tsparticles-preset-fire.svg)](https://www.npmjs.com/package/tsparticles-preset-fire) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-fire)](https://www.npmjs.com/package/tsparticles-preset-fire)
480
481This preset loads a faded red to a black background with particles colored like fire and ash sparks.
482
483[![demo](https://github.com/tsparticles/presets/raw/main/presets/fire/images/sample.png)](https://particles.js.org/samples/presets/fire)
484
485You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/fire#readme)
486
487### Firefly
488
489[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-firefly/badge)](https://www.jsdelivr.com/package/npm/tsparticles-preset-firefly) [![npmjs](https://badge.fury.io/js/tsparticles-preset-firefly.svg)](https://www.npmjs.com/package/tsparticles-preset-firefly) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-firefly)](https://www.npmjs.com/package/tsparticles-preset-firefly)
490
491This preset loads a mouse trail made with small fading particles like little fireflies.
492
493[![demo](https://github.com/tsparticles/presets/raw/main/presets/firefly/images/sample.png)](https://particles.js.org/samples/presets/firefly)
494
495You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/firefly#readme)
496
497### Fireworks
498
499[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-fireworks/badge)](https://www.jsdelivr.com/package/npm/tsparticles-preset-fireworks) [![npmjs](https://badge.fury.io/js/tsparticles-preset-fireworks.svg)](https://www.npmjs.com/package/tsparticles-preset-fireworks) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-fireworks)](https://www.npmjs.com/package/tsparticles-preset-fireworks)
500
501This preset loads a beautiful fireworks effect.
502
503[![demo](https://github.com/tsparticles/presets/raw/main/presets/fireworks/images/sample.png)](https://particles.js.org/samples/presets/fireworks)
504
505You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/fireworks#readme)
506
507### Fountain
508
509[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-fountain/badge)](https://www.jsdelivr.com/package/npm/tsparticles-preset-fountain) [![npmjs](https://badge.fury.io/js/tsparticles-preset-fountain.svg)](https://www.npmjs.com/package/tsparticles-preset-fountain) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-fountain)](https://www.npmjs.com/package/tsparticles-preset-fountain)
510
511[![demo](https://github.com/tsparticles/presets/raw/main/presets/fountain/images/sample.png)](https://particles.js.org/samples/presets/fountain)
512
513You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/fountain#readme)
514
515### Links
516
517[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-links/badge)](https://www.jsdelivr.com/package/npm/tsparticles-preset-links) [![npmjs](https://badge.fury.io/js/tsparticles-preset-links.svg)](https://www.npmjs.com/package/tsparticles-preset-links) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-links)](https://www.npmjs.com/package/tsparticles-preset-links)
518
519[![demo](https://github.com/tsparticles/presets/raw/main/presets/links/images/sample.png)](https://particles.js.org/samples/presets/links)
520
521You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/links#readme)
522
523### Sea Anemone
524
525[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-sea-anemone/badge)](https://www.jsdelivr.com/package/npm/tsparticles-preset-sea-anemone) [![npmjs](https://badge.fury.io/js/tsparticles-preset-sea-anemone.svg)](https://www.npmjs.com/package/tsparticles-preset-sea-anemone) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-sea-anemone)](https://www.npmjs.com/package/tsparticles-preset-sea-anemone)
526
527[![demo](https://github.com/tsparticles/presets/raw/main/presets/seaAnemone/images/sample.png)](https://particles.js.org/samples/presets/seaAnemone)
528
529You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/seaAnemone#readme)
530
531### Snow
532
533[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-snow/badge)](https://www.jsdelivr.com/package/npm/tsparticles-preset-snow) [![npmjs](https://badge.fury.io/js/tsparticles-preset-snow.svg)](https://www.npmjs.com/package/tsparticles-preset-snow) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-snow)](https://www.npmjs.com/package/tsparticles-preset-snow)
534
535[![demo](https://github.com/tsparticles/presets/raw/main/presets/snow/images/sample.png)](https://particles.js.org/samples/presets/snow)
536
537You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/snow#readme)
538
539### Stars
540
541[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-stars/badge)](https://www.jsdelivr.com/package/npm/tsparticles-preset-stars) [![npmjs](https://badge.fury.io/js/tsparticles-preset-stars.svg)](https://www.npmjs.com/package/tsparticles-preset-stars) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-stars)](https://www.npmjs.com/package/tsparticles-preset-stars)
542
543[![demo](https://github.com/tsparticles/presets/raw/main/presets/stars/images/sample.png)](https://particles.js.org/samples/presets/stars)
544
545You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/stars#readme)
546
547### Triangles
548
549[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-preset-triangles/badge?style=for-the-badge)](https://www.jsdelivr.com/package/npm/tsparticles-preset-triangles) [![npmjs](https://badge.fury.io/js/tsparticles-preset-triangles.svg)](https://www.npmjs.com/package/tsparticles-preset-triangles) [![npmjs](https://img.shields.io/npm/dt/tsparticles-preset-triangles)](https://www.npmjs.com/package/tsparticles-preset-triangles)
550
551[![demo](https://github.com/tsparticles/presets/raw/main/presets/triangles/images/sample.png)](https://particles.js.org/samples/presets/triangles)
552
553You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/triangles#readme)
554
555---
556
557## Templates and Resources
558
559You can find some tsParticles related templates [here](https://github.com/tsparticles/templates). The templates are
560created for _Vanilla Javascript_, _ReactJS_, _VueJS_, _Angular_, _SvelteJS_, and other frameworks.
561
562The templates will vary, new ones can be created or older ones updated with the latest features or changed to a better
563style. Check them out once in a while.
564
565If you created some good design with _tsParticles_ feel free to submit a pull request with your cool template, you'll be
566credited as the template author!
567
568<https://github.com/tsparticles/templates>
569
570---
571
572## **_Demo / Generator_**
573
574<https://particles.js.org/samples>
575
576[![Particles demo](https://particles.js.org/images/demo2.png?v=1.39.1)](https://particles.js.org/samples)
577
578---
579
580## **_Video Tutorials_**
581
582You can find all video tutorials on the website here: <https://particles.js.org/video.html>
583
584_More videos are coming soon! Check every day if there are some new contents._
585
586---
587
588### Characters as particles
589
590[![Particles chars demo](https://media.giphy.com/media/JsssOXz72bM6jGEZ0s/giphy.gif)](https://particles.js.org/samples/#chars)
591
592---
593
594### Polygon mask
595
596[![tsParticles Polygon Mask demo](https://media.giphy.com/media/lNRfiSgaMFbL4FMhW6/giphy.gif)](https://particles.js.org/samples/#polygonMask)
597
598---
599
600### Animated stars
601
602[![Particles NASA demo](https://media.giphy.com/media/cLqGsnh7FKRVMgPIWE/giphy.gif)](https://particles.js.org/samples/#nasa)
603
604---
605
606### Nyan cat flying on scrolling stars
607
608[![Particles Nyan Cat demo](https://media.giphy.com/media/LpX2oNc9ZMgIhIXQL9/giphy.gif)](https://particles.js.org/samples/#nyancat2)
609
610---
611
612### Snow particles
613
614[![tsParticles Snow demo](https://media.giphy.com/media/gihwUFbmiubbkdzEMX/giphy.gif)](https://particles.js.org/samples/#snow)
615
616---
617
618### Background Mask particles
619
620[![tsParticles Background Mask demo](https://media.giphy.com/media/dWraWgqInWFGWiOyRu/giphy.gif)](https://particles.js.org/samples/#background)
621
622---
623
624**particles.json**
625
626You can find some config samples [here](https://github.com/tsparticles/website/tree/main/presets) 📖
627
628---
629
630## **_Options_**
631
632You can find all options
633available [here](https://particles.js.org/docs/interfaces/tsParticles_Engine.Options_Interfaces_IOptions.IOptions.html)
634📖
635
636## Want to see it in action and try it?
637
638I've created a tsParticles collection on [CodePen](https://codepen.io/collection/DPOage) 😮 or you can check out
639my [profile](https://codepen.io/matteobruni)
640
641Otherwise, there's the demo page link below.
642
643[![tsParticles demo](https://media.giphy.com/media/fsVN1ZHksgBIXNIbr1/giphy.gif)](https://particles.js.org/samples/)
644
645Want to see even more demos? Clone the repository on your computer and follow these instructions
646
647```shell
648$ pnpm i
649$ pnpm run build
650$ cd demo/vanilla
651$ pnpm start
652```
653
654**Boom! 💥** <http://localhost:3000> and you can check out other demos.
655
656_If you are brave enough_ you can switch to the `dev` branch for trying the features under development.
657
658---
659
660## Migrating from Particles.js
661
662**tsParticles** has a package that makes this library 100% compatible with the _particles.js_ configuration.
663
664[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-particles.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/tsparticles-particles.js) [![npmjs](https://badge.fury.io/js/tsparticles-particles.js.svg)](https://www.npmjs.com/package/tsparticles-particles.js) [![npm](https://img.shields.io/npm/dm/tsparticles-particles.js)](https://www.npmjs.com/package/tsparticles-particles.js)
665
666Seriously, you just need to change the script from particles.js to the bundled compatibility package, et-voilà, **you're
667ready** 🧙!
668
669You can read more **[here](https://dev.to/matteobruni/migrating-from-particles-js-to-tsparticles-2a6m)**
670
671Want to know 5 reasons to do the
672switch? [Read here](https://dev.to/matteobruni/5-reasons-to-use-tsparticles-and-not-particles-js-1gbe)
673
674_Below you can find all the information you need to install tsParticles and its new syntax._
675
676---
677
678## Plugins/Customizations
679
680tsParticles now supports some customizations 🥳.
681
682**You can create your own plugins**
683
684_Read more [here](https://particles.js.org/docs/modules/Core_Interfaces_IPlugin.html)..._
685
686---
687
688## Dependency Graph
689
690```mermaid
691flowchart LR
692
693subgraph b [Bundles]
694bb[tsParticles Basic] --> bs[tsParticles Slim]
695bp[Particles.js compatibility bundle] --> bs
696bs --> bf[tsParticles]
697end
698
699e[tsParticles Engine] --> b
700
701iea & iebo & iebu & iec & ieg & iepa & iepu & ierem & ierep & ies --> bs
702ipa & ipc & ipl --> bs
703mb --> bb
704mp --> bs
705pleq --> bs
706sci --> bb
707si & sl & spo & ssq & sst & st --> bs
708uc & uop & uou & usi --> bb
709ul & urot & ust --> bs
710
711iet --> bf
712pla & plem --> bf
713urol & uti & utw & uw --> bf
714
715subgraph i [Interactions]
716
717subgraph ie [Externals]
718iea[Attract]
719iebo[Bounce]
720iebu[Bubble]
721iec[Connect]
722ieg[Grab]
723iepa[Pause]
724iepu[Push]
725ierem[Remove]
726ierep[Repulse]
727ies[Slow]
728iet[Trail]
729end
730
731il[Light]
732
733subgraph ip [Particles]
734ipa[Attract]
735ipc[Collisions]
736ipl[Links]
737ipr[Repulse]
738end
739
740end
741
742i --> ie
743i --> ip
744
745e --> i
746
747subgraph m [Movers]
748mb[Base]
749mp[Parallax]
750end
751
752e --> m
753
754subgraph pa [Paths]
755pac[Curves]
756papn[Perlin Noise]
757pap[Polygon]
758pasn[Simplex Noise]
759pasvg[SVG]
760end
761
762e --> pa
763
764subgraph pl [Plugins]
765pla[Absorbers]
766plcm[Canvas Mask]
767plem[Emitters]
768plh[HSV Color]
769pli[Infection]
770plm[Motion]
771plp[Polygon Mask]
772pls[Sounds]
773
774subgraph plea [Easings]
775pleb[Back]
776pleci[Circ]
777plecu[Cubic]
778plee[Expo]
779pleq[Quad]
780ple4[Quart]
781ple5[Quint]
782ples[Sine]
783end
784
785subgraph plex [Exports]
786plexi[Image]
787plexj[JSON]
788plexv[Video]
789end
790
791end
792
793pl --> plea
794
795e --> pl
796
797subgraph s [Shapes]
798sa[Arrow]
799sb[Bubble]
800sci[Circle]
801scog[Cog]
802sh[Heart]
803si[Image]
804sl[Line]
805smt[Multiline Text]
806spa[Path]
807spo[Polygon]
808srp[Rounded Polygon]
809srr[Rounded Rectangle]
810ssp[Spiral]
811ssq[Square]
812sst[Star]
813st[Text]
814end
815
816e --> s
817
818subgraph u [Updaters]
819uc[Color]
820ud[Destroy]
821ug[Gradient]
822ul[Life]
823uop[Opacity]
824uor[Orbit]
825uou[Out Modes]
826urol[Roll]
827urot[Rotate]
828usi[Size]
829ust[Stroke Color]
830uti[Tilt]
831utw[Twinkle]
832uw[Wobble]
833end
834
835e --> u
836```
837
838---
839
840<p>
841 <a href="https://www.jetbrains.com/?from=tsParticles">
842 <img src="https://raw.githubusercontent.com/matteobruni/tsparticles/gh-pages/images/jetbrains-logos/jetbrains-variant-4.png" height="150" alt="JetBrains" />
843 </a>
844 <a href="https://www.jetbrains.com/webstorm/?from=tsParticles">
845 <img src="https://raw.githubusercontent.com/matteobruni/tsparticles/gh-pages/images/jetbrains-logos/logo.png" height="150" alt="JetBrains" />
846 </a>
847</p>
848
849## Sponsors
850
851### ScribbleMaps
852
853Huge thanks to [ScribbleMaps](https://www.scribblemaps.com/) for their support on this project.
854
855### JetBrains
856
857Huge thanks to [JetBrains](https://www.jetbrains.com/?from=tsParticles) for the 2020-2022 Open Source Licenses!
858
859[JetBrains WebStorm](https://www.jetbrains.com/webstorm/?from=tsParticles) is used to maintain this project.