Skip to content

すぐに使えるデモ

これらのレシピは、presets/presets ワークスペース (リリースに向けたベータ/アルファ) で利用可能な公式プリセットを使用します。

パターンベースの開始/停止 (自動再生なし)

ts
import { tsParticles } from "@tsparticles/engine";
import type { Container, ISourceOptions } from "@tsparticles/engine";

let container: Container | undefined;

export async function start(id: string, options: ISourceOptions): Promise<void> {
  container?.destroy();
  container = await tsParticles.load({ id, options });
}

export function stop(): void {
  container?.pause();
}

export function resume(): void {
  container?.play();
}

プリセットレシピ

UI ですぐにテストするには、Playground を使用し、必要な場合にのみ Start で開始します。

フレームワークのデモ プロジェクト

モノリポジトリには、実行可能な統合デモも含まれています。

  • ソースフォルダー: https://github.com/tsparticles/tsparticles/tree/main/demo
  • 利用可能なデモには次のものがあります: angularastroelectroninfernoionicjquerylitnextjsnextjs-legacynuxt2nuxt3nuxt4preactreactriotsolidsveltesvelte-kitvanillavanilla_newvitevue2vue3webcomponents