@tsparticles/template-particles 4.4.0 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +6 -2
  2. package/package.json +4 -4
  3. package/scripts/prebuild.js +1 -1
  4. package/template/angular/package.json +14 -14
  5. package/template/angular/src/app/app.component.ts +4 -3
  6. package/template/angular-confetti/package.json +16 -16
  7. package/template/angular-confetti/src/app/app.component.html +1 -1
  8. package/template/angular-confetti/src/app/app.component.ts +4 -3
  9. package/template/angular-fireworks/package.json +16 -16
  10. package/template/angular-fireworks/src/app/app.component.html +1 -1
  11. package/template/angular-fireworks/src/app/app.component.ts +4 -3
  12. package/template/astro/package.json +5 -5
  13. package/template/astro/src/pages/index.astro +7 -5
  14. package/template/ember/package.json +27 -7
  15. package/template/inferno/package.json +6 -5
  16. package/template/inferno/src/App.tsx +8 -9
  17. package/template/jquery/package.json +6 -5
  18. package/template/jquery/src/main.ts +5 -3
  19. package/template/lit/package.json +4 -4
  20. package/template/lit/src/my-app.ts +3 -3
  21. package/template/nextjs/package.json +8 -5
  22. package/template/nextjs/src/app/page.tsx +8 -8
  23. package/template/nuxt2/package.json +14 -4
  24. package/template/nuxt2/pages/index.vue +0 -6
  25. package/template/nuxt2/utils/particlesInit.js +5 -0
  26. package/template/nuxt3/app.vue +2 -3
  27. package/template/nuxt3/package.json +5 -4
  28. package/template/nuxt3/utils/particlesInit.ts +5 -0
  29. package/template/nuxt4/app.vue +2 -3
  30. package/template/nuxt4/package.json +6 -5
  31. package/template/nuxt4/utils/particlesInit.ts +5 -0
  32. package/template/preact/package.json +4 -4
  33. package/template/preact/src/App.tsx +5 -4
  34. package/template/qwik/package.json +6 -5
  35. package/template/qwik/src/App.tsx +5 -4
  36. package/template/react/package.json +4 -2
  37. package/template/react/src/App.tsx +4 -4
  38. package/template/riot/package.json +8 -6
  39. package/template/riot/src/app.riot +2 -3
  40. package/template/solid/package.json +2 -2
  41. package/template/solid/src/App.tsx +3 -3
  42. package/template/stencil/package.json +4 -4
  43. package/template/stencil/src/components/app-home/app-home.tsx +2 -3
  44. package/template/svelte/package.json +1 -1
  45. package/template/svelte/src/main.ts +3 -3
  46. package/template/vanilla/src/main.ts +2 -2
  47. package/template/vue2/package.json +4 -4
  48. package/template/vue2/src/App.vue +0 -6
  49. package/template/vue2/src/main.ts +14 -0
  50. package/template/vue3/package.json +1 -1
  51. package/template/vue3/src/main.ts +3 -3
  52. package/template/webcomponents/package.json +4 -4
  53. package/template/webcomponents/src/main.ts +50 -11
  54. package/template.json +4 -4
package/CHANGELOG.md CHANGED
@@ -3,11 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.5.0](https://github.com/tsparticles/tsparticles/compare/v4.4.0...v4.5.0) (2026-10-25)
7
+
8
+ **Note:** Version bump only for package @tsparticles/template-particles
9
+
6
10
  # [4.4.0](https://github.com/tsparticles/tsparticles/compare/v4.3.3...v4.4.0) (2026-08-30)
7
11
 
8
12
  ### Bug Fixes
9
13
 
10
- * various fixes for 4.4.0 ([475d06d](https://github.com/tsparticles/tsparticles/commit/475d06da27e1497bb097c0822fcfcb72d7142456))
14
+ - various fixes for 4.4.0 ([475d06d](https://github.com/tsparticles/tsparticles/commit/475d06da27e1497bb097c0822fcfcb72d7142456))
11
15
 
12
16
  ## [4.3.3](https://github.com/tsparticles/tsparticles/compare/v4.3.2...v4.3.3) (2026-07-23)
13
17
 
@@ -25,7 +29,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
25
29
 
26
30
  ### Bug Fixes
27
31
 
28
- * fixed angular confetti ([6f25a4a](https://github.com/tsparticles/tsparticles/commit/6f25a4a1eaa69c47f2668316e7b396fe55195f84))
32
+ - fixed angular confetti ([6f25a4a](https://github.com/tsparticles/tsparticles/commit/6f25a4a1eaa69c47f2668316e7b396fe55195f84))
29
33
 
30
34
  ## [4.2.1](https://github.com/tsparticles/tsparticles/compare/v4.2.0...v4.2.1) (2026-06-18)
31
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/template-particles",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -18,11 +18,11 @@
18
18
  "prepack": "pnpm run build"
19
19
  },
20
20
  "dependencies": {
21
- "@tsparticles/engine": "4.4.0",
22
- "@tsparticles/particles": "4.4.0"
21
+ "@tsparticles/engine": "4.5.0",
22
+ "@tsparticles/particles": "4.5.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "fs-extra": "^11.3.4"
26
26
  },
27
- "gitHead": "b7e605098d6ea937d5068c06542671d4891070e4"
27
+ "gitHead": "a637373a03c008ab38edaaecf6524ec4b8e332c0"
28
28
  }
@@ -51,7 +51,7 @@ fs.readFile(libPackage, function (error, data) {
51
51
  }
52
52
  }
53
53
 
54
- fs.writeFile(libPackage, JSON.stringify(libObj, undefined, 2), "utf-8", function () {
54
+ fs.writeFile(libPackage, `${JSON.stringify(libObj, undefined, 2)}\n`, "utf-8", function () {
55
55
  console.log("template.json dependencies updated successfully");
56
56
  });
57
57
  });
@@ -11,24 +11,24 @@
11
11
  "watch": "ng build --watch --configuration development"
12
12
  },
13
13
  "dependencies": {
14
- "@angular/animations": "~22.0.0",
15
- "@angular/common": "~22.0.0",
16
- "@angular/compiler": "~22.0.0",
17
- "@angular/core": "~22.0.0",
18
- "@angular/forms": "~22.0.0",
19
- "@angular/platform-browser": "~22.0.0",
20
- "@angular/platform-browser-dynamic": "~22.0.0",
21
- "@angular/router": "~22.0.0",
22
- "@tsparticles/angular": "^4.1.3",
23
- "@tsparticles/particles": "^4.0.0",
14
+ "@angular/animations": "~22.2.2",
15
+ "@angular/common": "~22.2.2",
16
+ "@angular/compiler": "~22.2.2",
17
+ "@angular/core": "~22.2.2",
18
+ "@angular/forms": "~22.2.2",
19
+ "@angular/platform-browser": "~22.2.2",
20
+ "@angular/platform-browser-dynamic": "~22.2.2",
21
+ "@angular/router": "~22.2.2",
22
+ "@tsparticles/angular": "^4.4.0",
23
+ "@tsparticles/particles": "^4.4.0",
24
24
  "rxjs": "~7.8.2",
25
25
  "tslib": "^2.8.1",
26
- "zone.js": "~0.16.2"
26
+ "zone.js": "~0.16.3"
27
27
  },
28
28
  "devDependencies": {
29
- "@angular-devkit/build-angular": "~22.0.0",
30
- "@angular/cli": "~22.0.0",
31
- "@angular/compiler-cli": "~22.0.0",
29
+ "@angular-devkit/build-angular": "~22.2.2",
30
+ "@angular/cli": "~22.2.2",
31
+ "@angular/compiler-cli": "~22.2.2",
32
32
  "typescript": "~6.0.3"
33
33
  }
34
34
  }
@@ -1,9 +1,10 @@
1
1
  import { Component, OnInit } from "@angular/core";
2
2
  import { NgParticlesService } from "@tsparticles/angular";
3
- import { loadParticles } from "@tsparticles/particles";
3
+ import { particles } from "@tsparticles/particles";
4
4
  import type { ISourceOptions } from "@tsparticles/engine";
5
5
 
6
6
  @Component({
7
+ standalone: false,
7
8
  selector: "app-root",
8
9
  templateUrl: "./app.component.html",
9
10
  styleUrls: ["./app.component.css"],
@@ -31,8 +32,8 @@ export class AppComponent implements OnInit {
31
32
  };
32
33
 
33
34
  ngOnInit(): void {
34
- void this.ngParticlesService.init(async (engine) => {
35
- await loadParticles(engine);
35
+ void this.ngParticlesService.init(async () => {
36
+ await particles.init();
36
37
  });
37
38
  }
38
39
  }
@@ -11,26 +11,26 @@
11
11
  "watch": "ng build --watch --configuration development"
12
12
  },
13
13
  "dependencies": {
14
- "@angular/animations": "~22.0.0",
15
- "@angular/common": "~22.0.0",
16
- "@angular/compiler": "~22.0.0",
17
- "@angular/core": "~22.0.0",
18
- "@angular/forms": "~22.0.0",
19
- "@angular/platform-browser": "~22.0.0",
20
- "@angular/platform-browser-dynamic": "~22.0.0",
21
- "@angular/router": "~22.0.0",
22
- "@tsparticles/angular": "^4.1.3",
23
- "@tsparticles/engine": "^4.0.0",
24
- "@tsparticles/particles": "^4.0.0",
25
- "@tsparticles/configs": "^4.0.0",
14
+ "@angular/animations": "~22.2.2",
15
+ "@angular/common": "~22.2.2",
16
+ "@angular/compiler": "~22.2.2",
17
+ "@angular/core": "~22.2.2",
18
+ "@angular/forms": "~22.2.2",
19
+ "@angular/platform-browser": "~22.2.2",
20
+ "@angular/platform-browser-dynamic": "~22.2.2",
21
+ "@angular/router": "~22.2.2",
22
+ "@tsparticles/angular": "^4.4.0",
23
+ "@tsparticles/engine": "^4.4.0",
24
+ "@tsparticles/particles": "^4.4.0",
25
+ "@tsparticles/configs": "^4.4.0",
26
26
  "rxjs": "~7.8.2",
27
27
  "tslib": "^2.8.1",
28
- "zone.js": "~0.16.2"
28
+ "zone.js": "~0.16.3"
29
29
  },
30
30
  "devDependencies": {
31
- "@angular-devkit/build-angular": "~22.0.0",
32
- "@angular/cli": "~22.0.0",
33
- "@angular/compiler-cli": "~22.0.0",
31
+ "@angular-devkit/build-angular": "~22.2.2",
32
+ "@angular/cli": "~22.2.2",
33
+ "@angular/compiler-cli": "~22.2.2",
34
34
  "typescript": "~6.0.3"
35
35
  }
36
36
  }
@@ -1,4 +1,4 @@
1
1
  <div id="app">
2
2
  <h1>tsParticles</h1>
3
3
  </div>
4
- <ng-particles id="tsparticles" [options]="options"></ng-particles>
4
+ <ngx-particles id="tsparticles" [options]="options"></ngx-particles>
@@ -1,9 +1,10 @@
1
1
  import { Component, OnInit } from "@angular/core";
2
2
  import { NgParticlesService } from "@tsparticles/angular";
3
- import { loadParticles } from "@tsparticles/particles";
3
+ import { particles } from "@tsparticles/particles";
4
4
  import type { ISourceOptions } from "@tsparticles/engine";
5
5
 
6
6
  @Component({
7
+ standalone: false,
7
8
  selector: "app-root",
8
9
  templateUrl: "./app.component.html",
9
10
  styleUrls: ["./app.component.css"],
@@ -31,8 +32,8 @@ export class AppComponent implements OnInit {
31
32
  };
32
33
 
33
34
  ngOnInit(): void {
34
- void this.ngParticlesService.init(async (engine) => {
35
- await loadParticles(engine);
35
+ void this.ngParticlesService.init(async () => {
36
+ await particles.init();
36
37
  });
37
38
  }
38
39
  }
@@ -11,26 +11,26 @@
11
11
  "watch": "ng build --watch --configuration development"
12
12
  },
13
13
  "dependencies": {
14
- "@angular/animations": "~22.0.0",
15
- "@angular/common": "~22.0.0",
16
- "@angular/compiler": "~22.0.0",
17
- "@angular/core": "~22.0.0",
18
- "@angular/forms": "~22.0.0",
19
- "@angular/platform-browser": "~22.0.0",
20
- "@angular/platform-browser-dynamic": "~22.0.0",
21
- "@angular/router": "~22.0.0",
22
- "@tsparticles/angular": "^4.1.3",
23
- "@tsparticles/engine": "^4.0.0",
24
- "@tsparticles/particles": "^4.0.0",
25
- "@tsparticles/configs": "^4.0.0",
14
+ "@angular/animations": "~22.2.2",
15
+ "@angular/common": "~22.2.2",
16
+ "@angular/compiler": "~22.2.2",
17
+ "@angular/core": "~22.2.2",
18
+ "@angular/forms": "~22.2.2",
19
+ "@angular/platform-browser": "~22.2.2",
20
+ "@angular/platform-browser-dynamic": "~22.2.2",
21
+ "@angular/router": "~22.2.2",
22
+ "@tsparticles/angular": "^4.4.0",
23
+ "@tsparticles/engine": "^4.4.0",
24
+ "@tsparticles/particles": "^4.4.0",
25
+ "@tsparticles/configs": "^4.4.0",
26
26
  "rxjs": "~7.8.2",
27
27
  "tslib": "^2.8.1",
28
- "zone.js": "~0.16.2"
28
+ "zone.js": "~0.16.3"
29
29
  },
30
30
  "devDependencies": {
31
- "@angular-devkit/build-angular": "~22.0.0",
32
- "@angular/cli": "~22.0.0",
33
- "@angular/compiler-cli": "~22.0.0",
31
+ "@angular-devkit/build-angular": "~22.2.2",
32
+ "@angular/cli": "~22.2.2",
33
+ "@angular/compiler-cli": "~22.2.2",
34
34
  "typescript": "~6.0.3"
35
35
  }
36
36
  }
@@ -1,4 +1,4 @@
1
1
  <div id="app">
2
2
  <h1>tsParticles</h1>
3
3
  </div>
4
- <ng-particles id="tsparticles" [options]="options"></ng-particles>
4
+ <ngx-particles id="tsparticles" [options]="options"></ngx-particles>
@@ -1,9 +1,10 @@
1
1
  import { Component, OnInit } from "@angular/core";
2
2
  import { NgParticlesService } from "@tsparticles/angular";
3
- import { loadParticles } from "@tsparticles/particles";
3
+ import { particles } from "@tsparticles/particles";
4
4
  import type { ISourceOptions } from "@tsparticles/engine";
5
5
 
6
6
  @Component({
7
+ standalone: false,
7
8
  selector: "app-root",
8
9
  templateUrl: "./app.component.html",
9
10
  styleUrls: ["./app.component.css"],
@@ -31,8 +32,8 @@ export class AppComponent implements OnInit {
31
32
  };
32
33
 
33
34
  ngOnInit(): void {
34
- void this.ngParticlesService.init(async (engine) => {
35
- await loadParticles(engine);
35
+ void this.ngParticlesService.init(async () => {
36
+ await particles.init();
36
37
  });
37
38
  }
38
39
  }
@@ -9,10 +9,10 @@
9
9
  "preview": "astro preview"
10
10
  },
11
11
  "dependencies": {
12
- "astro": "^5.7.0",
13
- "@tsparticles/engine": "^4.0.0",
14
- "@tsparticles/particles": "^4.0.0",
15
- "@tsparticles/configs": "^4.0.0",
16
- "@tsparticles/astro": "^4.1.3"
12
+ "astro": "^7.3.2",
13
+ "@tsparticles/engine": "^4.4.0",
14
+ "@tsparticles/particles": "^4.4.0",
15
+ "@tsparticles/configs": "^4.4.0",
16
+ "@tsparticles/astro": "^4.4.0"
17
17
  }
18
18
  }
@@ -1,6 +1,5 @@
1
1
  ---
2
- import { loadParticles } from "@tsparticles/particles";
3
- import { tsParticles } from "@tsparticles/engine";
2
+ import Particles from "@tsparticles/astro";
4
3
  import type { ISourceOptions } from "@tsparticles/engine";
5
4
 
6
5
  const options: ISourceOptions = {
@@ -45,9 +44,12 @@ const options: ISourceOptions = {
45
44
  </div>
46
45
  <Particles id="tsparticles" options={options} client:load />
47
46
  <script>
48
- import { loadParticles } from "@tsparticles/particles";
49
- import { tsParticles } from "@tsparticles/engine";
50
- void loadParticles(tsParticles);
47
+ import { initParticlesEngine } from "@tsparticles/astro";
48
+ import { particles } from "@tsparticles/particles";
49
+
50
+ void initParticlesEngine(async () => {
51
+ await particles.init();
52
+ });
51
53
  </script>
52
54
  </body>
53
55
  </html>
@@ -7,14 +7,34 @@
7
7
  "build": "ember build",
8
8
  "preview": "ember serve"
9
9
  },
10
+ "devDependencies": {
11
+ "@ember/optional-features": "^3.0.0",
12
+ "@glimmer/component": "^2.1.1",
13
+ "@glimmer/tracking": "^1.1.2",
14
+ "broccoli-asset-rev": "^3.0.0",
15
+ "ember-auto-import": "^2.13.1",
16
+ "ember-cli": "~6.12.0",
17
+ "ember-cli-babel": "^8.3.1",
18
+ "ember-cli-htmlbars": "^7.0.1",
19
+ "ember-cli-inject-live-reload": "^2.1.0",
20
+ "ember-cli-sri": "^2.1.1",
21
+ "ember-cli-terser": "^4.0.2",
22
+ "ember-load-initializers": "^3.0.1",
23
+ "ember-modifier": "^4.3.0",
24
+ "ember-resolver": "^13.2.0",
25
+ "ember-source": "~6.12.0",
26
+ "loader.js": "^4.7.0",
27
+ "typescript": "^6.0.3",
28
+ "webpack": "^5.106.1"
29
+ },
10
30
  "dependencies": {
11
- "ember-source": "^6.4.0",
12
- "@tsparticles/engine": "^4.0.0",
13
- "@tsparticles/particles": "^4.0.0",
14
- "@tsparticles/configs": "^4.0.0",
15
- "@tsparticles/ember": "^4.1.3"
31
+ "@tsparticles/configs": "^4.4.0",
32
+ "@tsparticles/ember": "^4.4.0",
33
+ "@tsparticles/engine": "^4.4.0",
34
+ "@tsparticles/particles": "^4.4.0",
35
+ "@tsparticles/slim": "^4.4.0"
16
36
  },
17
- "devDependencies": {
18
- "ember-cli": "^6.3.1"
37
+ "ember": {
38
+ "edition": "octane"
19
39
  }
20
40
  }
@@ -9,11 +9,12 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "inferno": "^9.0.4",
13
- "@tsparticles/engine": "^4.0.0",
14
- "@tsparticles/particles": "^4.0.0",
15
- "@tsparticles/configs": "^4.0.0",
16
- "@tsparticles/inferno": "^4.1.3"
12
+ "inferno": "^9.1.0",
13
+ "inferno-create-element": "^9.1.0",
14
+ "@tsparticles/engine": "^4.4.0",
15
+ "@tsparticles/particles": "^4.4.0",
16
+ "@tsparticles/configs": "^4.4.0",
17
+ "@tsparticles/inferno": "^4.4.0"
17
18
  },
18
19
  "devDependencies": {
19
20
  "typescript": "~5.8.3"
@@ -1,10 +1,13 @@
1
1
  import { Component } from "inferno";
2
- import Particles from "@tsparticles/inferno";
3
- import { loadParticles } from "@tsparticles/particles";
4
- import { tsParticles } from "@tsparticles/engine";
2
+ import { Particles, ParticlesProvider } from "@tsparticles/inferno";
3
+ import { particles } from "@tsparticles/particles";
5
4
  import type { ISourceOptions } from "@tsparticles/engine";
6
5
  import "./App.css";
7
6
 
7
+ async function init(): Promise<void> {
8
+ await particles.init();
9
+ }
10
+
8
11
  const options: ISourceOptions = {
9
12
  background: { color: { value: "#0d0d2b" } },
10
13
  fpsLimit: 120,
@@ -25,18 +28,14 @@ const options: ISourceOptions = {
25
28
  };
26
29
 
27
30
  export default class App extends Component {
28
- componentDidMount() {
29
- void loadParticles(tsParticles);
30
- }
31
-
32
31
  render() {
33
32
  return (
34
- <>
33
+ <ParticlesProvider init={init}>
35
34
  <div id="app">
36
35
  <h1>tsParticles</h1>
37
36
  </div>
38
37
  <Particles id="tsparticles" options={options} />
39
- </>
38
+ </ParticlesProvider>
40
39
  );
41
40
  }
42
41
  }
@@ -10,12 +10,13 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "jquery": "^3.7.1",
13
- "@tsparticles/engine": "^4.0.0",
14
- "@tsparticles/particles": "^4.0.0",
15
- "@tsparticles/configs": "^4.0.0",
16
- "@tsparticles/jquery": "^4.1.3"
13
+ "@tsparticles/engine": "^4.4.0",
14
+ "@tsparticles/particles": "^4.4.0",
15
+ "@tsparticles/configs": "^4.4.0",
16
+ "@tsparticles/jquery": "^4.4.0"
17
17
  },
18
18
  "devDependencies": {
19
- "typescript": "~5.8.3"
19
+ "typescript": "~5.8.3",
20
+ "@types/jquery": "^3.5.32"
20
21
  }
21
22
  }
@@ -1,14 +1,16 @@
1
1
  import "./style.css";
2
2
  import $ from "jquery";
3
- import { loadParticles } from "@tsparticles/particles";
3
+ import "@tsparticles/jquery";
4
4
  import { tsParticles } from "@tsparticles/engine";
5
+ import { loadSlim } from "@tsparticles/slim";
5
6
 
6
7
  (async () => {
7
- await loadParticles(tsParticles);
8
+ await loadSlim(tsParticles);
8
9
 
9
10
  $(() => {
10
11
  $("#app").after('<div id="tsparticles"></div>');
11
- $("#tsparticles").particles({
12
+
13
+ $("#tsparticles").particles().load({
12
14
  background: { color: { value: "#0d0d2b" } },
13
15
  fpsLimit: 120,
14
16
  particles: {
@@ -10,10 +10,10 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "lit": "^3.2.1",
13
- "@tsparticles/engine": "^4.0.0",
14
- "@tsparticles/particles": "^4.0.0",
15
- "@tsparticles/configs": "^4.0.0",
16
- "@tsparticles/lit": "^4.1.3"
13
+ "@tsparticles/engine": "^4.4.0",
14
+ "@tsparticles/particles": "^4.4.0",
15
+ "@tsparticles/configs": "^4.4.0",
16
+ "@tsparticles/lit": "^4.4.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "typescript": "~5.8.3"
@@ -1,7 +1,7 @@
1
1
  import { LitElement, html } from "lit";
2
2
  import { customElement, state } from "lit/decorators.js";
3
3
  import { initParticlesEngine } from "@tsparticles/lit";
4
- import { loadParticles } from "@tsparticles/particles";
4
+ import { particles } from "@tsparticles/particles";
5
5
  import type { ISourceOptions } from "@tsparticles/engine";
6
6
 
7
7
  const options: ISourceOptions = {
@@ -30,8 +30,8 @@ export class MyApp extends LitElement {
30
30
 
31
31
  connectedCallback(): void {
32
32
  super.connectedCallback();
33
- void initParticlesEngine(async (engine) => {
34
- await loadParticles(engine);
33
+ void initParticlesEngine(async () => {
34
+ await particles.init();
35
35
  this.initialized = true;
36
36
  });
37
37
  }
@@ -13,12 +13,15 @@
13
13
  "next": "^15.3.1",
14
14
  "react": "^19.2.5",
15
15
  "react-dom": "^19.2.5",
16
- "@tsparticles/engine": "^4.0.0",
17
- "@tsparticles/particles": "^4.0.0",
18
- "@tsparticles/configs": "^4.0.0",
19
- "@tsparticles/nextjs": "^4.1.3"
16
+ "@tsparticles/engine": "^4.4.0",
17
+ "@tsparticles/particles": "^4.4.0",
18
+ "@tsparticles/configs": "^4.4.0",
19
+ "@tsparticles/nextjs": "^4.4.0"
20
20
  },
21
21
  "devDependencies": {
22
- "typescript": "~5.8.3"
22
+ "@types/node": "^24.10.1",
23
+ "@types/react": "^19.2.14",
24
+ "@types/react-dom": "^19.2.3",
25
+ "typescript": "^6.0.3"
23
26
  }
24
27
  }
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
 
3
- import Particles from "@tsparticles/nextjs";
4
- import { loadParticles } from "@tsparticles/particles";
5
- import type { Engine, ISourceOptions } from "@tsparticles/engine";
3
+ import { NextParticles, NextParticlesProvider } from "@tsparticles/nextjs";
4
+ import { particles } from "@tsparticles/particles";
5
+ import type { ISourceOptions } from "@tsparticles/engine";
6
6
 
7
- async function init(engine: Engine): Promise<void> {
8
- await loadParticles(engine);
7
+ async function init(): Promise<void> {
8
+ await particles.init();
9
9
  }
10
10
 
11
11
  const options: ISourceOptions = {
@@ -29,11 +29,11 @@ const options: ISourceOptions = {
29
29
 
30
30
  export default function Home() {
31
31
  return (
32
- <>
32
+ <NextParticlesProvider init={init}>
33
33
  <div id="app">
34
34
  <h1>tsParticles</h1>
35
35
  </div>
36
- <Particles id="tsparticles" init={init} options={options} />
37
- </>
36
+ <NextParticles id="tsparticles" options={options} />
37
+ </NextParticlesProvider>
38
38
  );
39
39
  }
@@ -12,9 +12,19 @@
12
12
  "nuxt": "^2.18.1",
13
13
  "vue": "^2.7.16",
14
14
  "vue-template-compiler": "^2.7.16",
15
- "@tsparticles/engine": "^4.0.0",
16
- "@tsparticles/particles": "^4.0.0",
17
- "@tsparticles/configs": "^4.0.0",
18
- "@tsparticles/vue2": "^4.1.3"
15
+ "@tsparticles/engine": "^4.4.0",
16
+ "@tsparticles/particles": "^4.4.0",
17
+ "@tsparticles/configs": "^4.4.0",
18
+ "@tsparticles/vue2": "^4.4.0",
19
+ "@tsparticles/nuxt2": "^4.4.0"
20
+ },
21
+ "browserslist": [
22
+ "chrome 58",
23
+ "edge 16",
24
+ "firefox 57",
25
+ "safari 11"
26
+ ],
27
+ "devDependencies": {
28
+ "@babel/preset-env": "^7.29.0"
19
29
  }
20
30
  }
@@ -6,9 +6,6 @@
6
6
  </template>
7
7
 
8
8
  <script>
9
- import { loadParticles } from "@tsparticles/particles";
10
- import { tsParticles } from "@tsparticles/engine";
11
-
12
9
  export default {
13
10
  name: "HomePage",
14
11
  data() {
@@ -52,9 +49,6 @@ export default {
52
49
  },
53
50
  };
54
51
  },
55
- mounted() {
56
- void loadParticles(tsParticles);
57
- },
58
52
  };
59
53
  </script>
60
54
 
@@ -0,0 +1,5 @@
1
+ export async function registerParticles() {
2
+ const { particles } = await import("@tsparticles/particles");
3
+
4
+ await particles.init();
5
+ }
@@ -1,7 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { onMounted } from "vue";
3
- import { loadParticles } from "@tsparticles/particles";
4
- import { tsParticles } from "@tsparticles/engine";
3
+ import { particles } from "@tsparticles/particles";
5
4
  import type { ISourceOptions } from "@tsparticles/engine";
6
5
 
7
6
  const options: ISourceOptions = {
@@ -24,7 +23,7 @@ const options: ISourceOptions = {
24
23
  };
25
24
 
26
25
  onMounted(() => {
27
- void loadParticles(tsParticles);
26
+ void particles.init();
28
27
  });
29
28
  </script>
30
29
 
@@ -10,9 +10,10 @@
10
10
  "dependencies": {
11
11
  "nuxt": "^3.17.1",
12
12
  "vue": "^3.5.32",
13
- "@tsparticles/engine": "^4.0.0",
14
- "@tsparticles/particles": "^4.0.0",
15
- "@tsparticles/configs": "^4.0.0",
16
- "@tsparticles/vue3": "^4.1.3"
13
+ "@tsparticles/engine": "^4.4.0",
14
+ "@tsparticles/particles": "^4.4.0",
15
+ "@tsparticles/configs": "^4.4.0",
16
+ "@tsparticles/vue3": "^4.4.0",
17
+ "@tsparticles/nuxt3": "^4.4.0"
17
18
  }
18
19
  }
@@ -0,0 +1,5 @@
1
+ import { particles } from "@tsparticles/particles";
2
+
3
+ export async function registerParticles(): Promise<void> {
4
+ await particles.init();
5
+ }
@@ -1,7 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { onMounted } from "vue";
3
- import { loadParticles } from "@tsparticles/particles";
4
- import { tsParticles } from "@tsparticles/engine";
3
+ import { particles } from "@tsparticles/particles";
5
4
  import type { ISourceOptions } from "@tsparticles/engine";
6
5
 
7
6
  const options: ISourceOptions = {
@@ -24,7 +23,7 @@ const options: ISourceOptions = {
24
23
  };
25
24
 
26
25
  onMounted(() => {
27
- void loadParticles(tsParticles);
26
+ void particles.init();
28
27
  });
29
28
  </script>
30
29
 
@@ -9,10 +9,11 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "nuxt": "^4.0.0",
12
- "vue": "^4.0.0",
13
- "@tsparticles/engine": "^4.0.0",
14
- "@tsparticles/particles": "^4.0.0",
15
- "@tsparticles/configs": "^4.0.0",
16
- "@tsparticles/vue3": "^4.1.3"
12
+ "vue": "^3.5.32",
13
+ "@tsparticles/engine": "^4.4.0",
14
+ "@tsparticles/particles": "^4.4.0",
15
+ "@tsparticles/configs": "^4.4.0",
16
+ "@tsparticles/vue3": "^4.4.0",
17
+ "@tsparticles/nuxt4": "^4.4.0"
17
18
  }
18
19
  }
@@ -0,0 +1,5 @@
1
+ import { particles } from "@tsparticles/particles";
2
+
3
+ export async function registerParticles(): Promise<void> {
4
+ await particles.init();
5
+ }
@@ -10,10 +10,10 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "preact": "^10.26.5",
13
- "@tsparticles/engine": "^4.0.0",
14
- "@tsparticles/particles": "^4.0.0",
15
- "@tsparticles/configs": "^4.0.0",
16
- "@tsparticles/preact": "^4.1.3"
13
+ "@tsparticles/engine": "^4.4.0",
14
+ "@tsparticles/particles": "^4.4.0",
15
+ "@tsparticles/configs": "^4.4.0",
16
+ "@tsparticles/preact": "^4.4.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@preact/preset-vite": "^2.10.1",
@@ -1,7 +1,6 @@
1
1
  import { useEffect } from "preact/hooks";
2
- import Particles from "@tsparticles/preact";
3
- import { loadParticles } from "@tsparticles/particles";
4
- import { tsParticles } from "@tsparticles/engine";
2
+ import Particles, { initParticlesEngine } from "@tsparticles/preact";
3
+ import { particles } from "@tsparticles/particles";
5
4
  import type { ISourceOptions } from "@tsparticles/engine";
6
5
  import "./App.css";
7
6
 
@@ -26,7 +25,9 @@ const options: ISourceOptions = {
26
25
 
27
26
  export default function App() {
28
27
  useEffect(() => {
29
- void loadParticles(tsParticles);
28
+ void initParticlesEngine(async () => {
29
+ await particles.init();
30
+ });
30
31
  }, []);
31
32
 
32
33
  return (
@@ -10,12 +10,13 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@builder.io/qwik": "^1.12.1",
13
- "@tsparticles/engine": "^4.0.0",
14
- "@tsparticles/particles": "^4.0.0",
15
- "@tsparticles/configs": "^4.0.0",
16
- "@tsparticles/qwik": "^4.1.3"
13
+ "@tsparticles/engine": "^4.4.0",
14
+ "@tsparticles/particles": "^4.4.0",
15
+ "@tsparticles/configs": "^4.4.0",
16
+ "@tsparticles/qwik": "^4.4.0"
17
17
  },
18
18
  "devDependencies": {
19
- "typescript": "~5.8.3"
19
+ "typescript": "~5.8.3",
20
+ "vite": "^7.3.6"
20
21
  }
21
22
  }
@@ -1,7 +1,6 @@
1
1
  import { component$, useVisibleTask$ } from "@builder.io/qwik";
2
- import { Particles } from "@tsparticles/qwik";
3
- import { loadParticles } from "@tsparticles/particles";
4
- import { tsParticles } from "@tsparticles/engine";
2
+ import { Particles, initParticlesEngine } from "@tsparticles/qwik";
3
+ import { particles } from "@tsparticles/particles";
5
4
  import type { ISourceOptions } from "@tsparticles/engine";
6
5
 
7
6
  const options: ISourceOptions = {
@@ -25,7 +24,9 @@ const options: ISourceOptions = {
25
24
 
26
25
  export default component$(() => {
27
26
  useVisibleTask$(() => {
28
- void loadParticles(tsParticles);
27
+ void initParticlesEngine(async () => {
28
+ await particles.init();
29
+ });
29
30
  });
30
31
 
31
32
  return (
@@ -11,9 +11,11 @@
11
11
  "dependencies": {
12
12
  "react": "^19.2.5",
13
13
  "react-dom": "^19.2.5",
14
- "@tsparticles/react": "^4.1.3"
14
+ "@tsparticles/react": "^4.4.0"
15
15
  },
16
16
  "devDependencies": {
17
- "@vitejs/plugin-react": "^6.0.1"
17
+ "@vitejs/plugin-react": "^6.0.1",
18
+ "@types/react": "^19.2.14",
19
+ "@types/react-dom": "^19.2.3"
18
20
  }
19
21
  }
@@ -1,10 +1,10 @@
1
1
  import Particles, { ParticlesProvider } from "@tsparticles/react";
2
- import { loadParticles } from "@tsparticles/particles";
3
- import type { Engine, ISourceOptions } from "@tsparticles/engine";
2
+ import { particles } from "@tsparticles/particles";
3
+ import type { ISourceOptions } from "@tsparticles/engine";
4
4
  import "./App.css";
5
5
 
6
- async function init(engine: Engine): Promise<void> {
7
- await loadParticles(engine);
6
+ async function init(): Promise<void> {
7
+ await particles.init();
8
8
  }
9
9
 
10
10
  const options: ISourceOptions = {
@@ -9,13 +9,15 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "riot": "^9.5.2",
13
- "@tsparticles/engine": "^4.0.0",
14
- "@tsparticles/particles": "^4.0.0",
15
- "@tsparticles/configs": "^4.0.0",
16
- "@tsparticles/riot": "^4.1.3"
12
+ "riot": "^10.1.6",
13
+ "@tsparticles/engine": "^4.4.0",
14
+ "@tsparticles/particles": "^4.4.0",
15
+ "@tsparticles/configs": "^4.4.0",
16
+ "@tsparticles/riot": "^4.4.0"
17
17
  },
18
18
  "devDependencies": {
19
- "typescript": "~5.8.3"
19
+ "typescript": "~5.8.3",
20
+ "@riotjs/compiler": "^10.0.4",
21
+ "rollup-plugin-riot": "^10.0.0"
20
22
  }
21
23
  }
@@ -21,11 +21,10 @@
21
21
  </style>
22
22
 
23
23
  <script>
24
- import { loadParticles } from "@tsparticles/particles";
25
- import { tsParticles } from "@tsparticles/engine";
24
+ import { particles } from "@tsparticles/particles";
26
25
 
27
26
  this.on("mount", () => {
28
- loadParticles(tsParticles);
27
+ void particles.init();
29
28
  });
30
29
  </script>
31
30
  </app>
@@ -10,9 +10,9 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "solid-js": "^1.8.11",
13
- "@tsparticles/solid": "^4.1.3"
13
+ "@tsparticles/solid": "^4.4.0"
14
14
  },
15
15
  "devDependencies": {
16
- "vite-plugin-solid": "^2.8.2"
16
+ "vite-plugin-solid": "^2.11.14"
17
17
  }
18
18
  }
@@ -1,12 +1,12 @@
1
1
  import { onMount } from "solid-js";
2
2
  import Particles, { initParticlesEngine } from "@tsparticles/solid";
3
- import { loadParticles } from "@tsparticles/particles";
3
+ import { particles } from "@tsparticles/particles";
4
4
  import type { ISourceOptions } from "@tsparticles/engine";
5
5
 
6
6
  export default function App() {
7
7
  onMount(() => {
8
- void initParticlesEngine(async (engine) => {
9
- await loadParticles(engine);
8
+ void initParticlesEngine(async () => {
9
+ await particles.init();
10
10
  });
11
11
  });
12
12
 
@@ -10,10 +10,10 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@stencil/core": "^4.26.0",
13
- "@tsparticles/engine": "^4.0.0",
14
- "@tsparticles/particles": "^4.0.0",
15
- "@tsparticles/configs": "^4.0.0",
16
- "@tsparticles/stencil": "^4.1.3"
13
+ "@tsparticles/engine": "^4.4.0",
14
+ "@tsparticles/particles": "^4.4.0",
15
+ "@tsparticles/configs": "^4.4.0",
16
+ "@tsparticles/stencil": "^4.4.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "typescript": "~5.8.3"
@@ -1,6 +1,5 @@
1
1
  import { Component, h } from "@stencil/core";
2
- import { loadParticles } from "@tsparticles/particles";
3
- import { tsParticles } from "@tsparticles/engine";
2
+ import { particles } from "@tsparticles/particles";
4
3
  import type { ISourceOptions } from "@tsparticles/engine";
5
4
 
6
5
  @Component({
@@ -48,7 +47,7 @@ export class AppHome {
48
47
  };
49
48
 
50
49
  componentDidLoad() {
51
- void loadParticles(tsParticles);
50
+ void particles.init();
52
51
  }
53
52
 
54
53
  render() {
@@ -9,7 +9,7 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "@tsparticles/svelte": "^4.1.3"
12
+ "@tsparticles/svelte": "^4.4.0"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
@@ -1,10 +1,10 @@
1
1
  import { mount } from "svelte";
2
2
  import { initParticlesEngine } from "@tsparticles/svelte";
3
- import { loadParticles } from "@tsparticles/particles";
3
+ import { particles } from "@tsparticles/particles";
4
4
  import App from "./App.svelte";
5
5
 
6
- void initParticlesEngine(async (engine) => {
7
- await loadParticles(engine);
6
+ void initParticlesEngine(async () => {
7
+ await particles.init();
8
8
  });
9
9
 
10
10
  const app = mount(App, { target: document.getElementById("app")! });
@@ -1,9 +1,9 @@
1
1
  import "./style.css";
2
2
  import { tsParticles } from "@tsparticles/engine";
3
- import { loadParticles } from "@tsparticles/particles";
3
+ import { particles } from "@tsparticles/particles";
4
4
 
5
5
  (async () => {
6
- await loadParticles(tsParticles);
6
+ await particles.init();
7
7
 
8
8
  await tsParticles.load({
9
9
  id: "tsparticles",
@@ -10,10 +10,10 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "vue": "^2.7.16",
13
- "@tsparticles/engine": "^4.0.0",
14
- "@tsparticles/particles": "^4.0.0",
15
- "@tsparticles/configs": "^4.0.0",
16
- "@tsparticles/vue2": "^4.1.3"
13
+ "@tsparticles/engine": "^4.4.0",
14
+ "@tsparticles/particles": "^4.4.0",
15
+ "@tsparticles/configs": "^4.4.0",
16
+ "@tsparticles/vue2": "^4.4.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@vitejs/plugin-vue2": "^2.3.3",
@@ -6,9 +6,6 @@
6
6
  </template>
7
7
 
8
8
  <script>
9
- import { loadParticles } from "@tsparticles/particles";
10
- import { tsParticles } from "@tsparticles/engine";
11
-
12
9
  export default {
13
10
  name: "App",
14
11
  data() {
@@ -52,9 +49,6 @@ export default {
52
49
  },
53
50
  };
54
51
  },
55
- mounted() {
56
- void loadParticles(tsParticles);
57
- },
58
52
  };
59
53
  </script>
60
54
 
@@ -0,0 +1,14 @@
1
+ import Vue from "vue";
2
+ import VueParticles from "@tsparticles/vue2";
3
+ import { particles } from "@tsparticles/particles";
4
+ import App from "./App.vue";
5
+
6
+ Vue.use(VueParticles, {
7
+ init: async () => {
8
+ await particles.init();
9
+ },
10
+ });
11
+
12
+ new Vue({
13
+ render: (h) => h(App),
14
+ }).$mount("#app");
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "vue": "^3.5.32",
13
- "@tsparticles/vue3": "^4.1.3"
13
+ "@tsparticles/vue3": "^4.4.0"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@vitejs/plugin-vue": "^6.0.5",
@@ -1,13 +1,13 @@
1
1
  import { createApp } from "vue";
2
2
  import Particles from "@tsparticles/vue3";
3
- import { loadParticles } from "@tsparticles/particles";
3
+ import { particles } from "@tsparticles/particles";
4
4
  import App from "./App.vue";
5
5
 
6
6
  const app = createApp(App);
7
7
 
8
8
  app.use(Particles, {
9
- init: async (engine) => {
10
- await loadParticles(engine);
9
+ init: async () => {
10
+ await particles.init();
11
11
  },
12
12
  });
13
13
 
@@ -9,10 +9,10 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "@tsparticles/engine": "^4.0.0",
13
- "@tsparticles/particles": "^4.0.0",
14
- "@tsparticles/configs": "^4.0.0",
15
- "@tsparticles/webcomponents": "^4.1.3"
12
+ "@tsparticles/engine": "^4.4.0",
13
+ "@tsparticles/particles": "^4.4.0",
14
+ "@tsparticles/configs": "^4.4.0",
15
+ "@tsparticles/webcomponents": "^4.4.0"
16
16
  },
17
17
  "devDependencies": {
18
18
  "typescript": "~5.8.3"
@@ -1,16 +1,55 @@
1
1
  import "./style.css";
2
- import { loadParticles } from "@tsparticles/particles";
3
2
  import { tsParticles } from "@tsparticles/engine";
3
+ import { particles } from "@tsparticles/particles";
4
+ import { defineParticlesElement, initParticlesEngine } from "@tsparticles/webcomponents";
5
+ import type { ISourceOptions } from "@tsparticles/engine";
4
6
 
5
- (async () => {
6
- await loadParticles(tsParticles);
7
+ globalThis.tsParticles = tsParticles;
7
8
 
8
- const app = document.createElement("div");
9
- app.id = "app";
10
- app.innerHTML = "<h1>tsParticles</h1>";
11
- document.body.appendChild(app);
9
+ const options: ISourceOptions = {
10
+ background: { color: { value: "#0d0d2b" } },
11
+ fpsLimit: 120,
12
+ particles: {
13
+ number: { value: 80, density: { enable: true } },
14
+ color: { value: "#ffffff" },
15
+ shape: { type: "circle" },
16
+ opacity: { value: 0.5 },
17
+ size: { value: { min: 1, max: 5 } },
18
+ links: {
19
+ enable: true,
20
+ distance: 150,
21
+ color: "#ffffff",
22
+ opacity: 0.3,
23
+ width: 1,
24
+ },
25
+ move: {
26
+ enable: true,
27
+ speed: 2,
28
+ direction: "none",
29
+ random: false,
30
+ straight: false,
31
+ outModes: { default: "bounce" },
32
+ },
33
+ },
34
+ interactivity: {
35
+ events: {
36
+ onHover: { enable: true, mode: "repulse" },
37
+ onClick: { enable: true, mode: "push" },
38
+ },
39
+ modes: {
40
+ repulse: { distance: 100, duration: 0.4 },
41
+ push: { quantity: 4 },
42
+ },
43
+ },
44
+ detectRetina: true,
45
+ };
12
46
 
13
- const particles = document.createElement("web-particles");
14
- particles.id = "tsparticles";
15
- document.body.appendChild(particles);
16
- })();
47
+ void initParticlesEngine(async () => {
48
+ await particles.init();
49
+ });
50
+
51
+ defineParticlesElement();
52
+
53
+ const particlesEl = document.getElementById("tsparticles");
54
+
55
+ (particlesEl as unknown as { options: ISourceOptions }).options = options;
package/template.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "package": {
3
3
  "dependencies": {
4
- "@tsparticles/engine": "^4.4.0",
5
- "@tsparticles/particles": "^4.4.0"
4
+ "@tsparticles/engine": "^4.5.0",
5
+ "@tsparticles/particles": "^4.5.0"
6
6
  },
7
7
  "devDependencies": {
8
8
  "typescript": "^6.0.3",
9
- "vite": "^8.1.0"
9
+ "vite": "^8.3.1"
10
10
  }
11
11
  }
12
- }
12
+ }