ラッパー: @tsparticles/nextjs
@tsparticles/react に基づいて構築された公式 Next.js ラッパー。
インストール
bash
pnpm add @tsparticles/nextjs @tsparticles/engine @tsparticles/slim簡単なセットアップの流れ
- Next.js ラッパーと依存関係をインストールします。
- パーティクル キャンバスに対してのみクライアント側でレンダリングを続けます。
- エンジンを一度初期化し、ラッパー コンポーネントをレンダリングします。
モノリポジトリ参照
- パッケージフォルダー: https://github.com/tsparticles/tsparticles/tree/main/wrappers/nextjs
- デモ アプリ: https://github.com/tsparticles/tsparticles/tree/main/demo/nextjs、https://github.com/tsparticles/tsparticles/tree/main/demo/nextjs-legacy
