Skip to content

Vorlagen und Ressourcen

tsParticles bietet zwei Kategorien von Vorlagen: Scaffold-Vorlagen (Framework-Gerüste) und Anwendungsfall-Vorlagen (vollständige Beispielanwendungen).

Schnellstart mit der CLI

Der einfachste Weg, eine Vorlage zu verwenden, ist über die CLI:

bash
npm create tsparticles@latest

Oder verwenden Sie direkt ein bestimmtes Bundle:

bash
npm create particles@latest
npm create confetti@latest
npm create ribbons@latest

Für die nicht-interaktive Nutzung:

bash
npx tsparticles-create app my-project --template scaffold --framework react
npx tsparticles-create app my-project --template confetti --framework vanilla

Scaffold-Vorlagen

Scaffold-Vorlagen bieten ein minimales Vite + TypeScript-Projektgerüst mit vorinstalliertem tsParticles. Sie sind für die folgenden Frameworks verfügbar:

FrameworkCLI-OptionPaket
Vanilla--framework vanilla@tsparticles/template-scaffold
React--framework react@tsparticles/template-scaffold
Vue 3--framework vue3@tsparticles/template-scaffold
Angular--framework angular@tsparticles/template-scaffold
Svelte--framework svelte@tsparticles/template-scaffold
Solid--framework solid@tsparticles/template-scaffold

Beispiel:

bash
npx tsparticles-create app my-react-app --template scaffold --framework react
cd my-react-app
npm install
npm run dev

Anwendungsfall-Vorlagen

Anwendungsfall-Vorlagen sind vollständige Beispielanwendungen, die die praktische Verwendung von tsParticles demonstrieren.

VorlageBeschreibungCLI-VorlagennamePaket
LoginLogin-/Registrierungsseite mit Partikelhintergrundlogin@tsparticles/template-login
PortfolioPersönliches Portfolio mit animiertem Hero-Bereichportfolio@tsparticles/template-portfolio
LandingMarketing-Landingpage mit wirkungsvollen Partikelnlanding@tsparticles/template-landing
Tic Tac ToeTic-Tac-Toe-Spiel mit Konfetti-Feiertictactoe@tsparticles/template-tictactoe
ConfettiKonfetti-Kanonen-Democonfetti@tsparticles/template-confetti
RibbonsBandanimations-Demoribbons@tsparticles/template-ribbons
ParticlesKlassisches particles.js-ähnliches Demoparticles@tsparticles/template-particles

Beispiel:

bash
npx tsparticles-create app my-portfolio --template portfolio --framework vanilla
cd my-portfolio
npm install
npm run dev

npm create-Wrapper

Für bundlespezifische Vorlagen können Sie dedizierte npm create-Wrapper verwenden:

BefehlVorlageFrameworkInstalliertes Bundle
npm create tsparticles@latestInteraktivInteraktivBenutzerwahl
npm create particles@latestparticlesVanilla@tsparticles/particles
npm create confetti@latestconfettiVanilla@tsparticles/confetti
npm create ribbons@latestribbonsVanilla@tsparticles/ribbons

CLI-Referenz

bash
tsparticles-create app [destination] [options]

Options:
  --template <name>     Template to use (scaffold|login|portfolio|landing|tictactoe|confetti|ribbons|particles)
  --framework <name>    Framework (vanilla|react|vue3|angular|svelte|solid)
  --skip-install        Skip npm install after scaffolding
  -h, --help            Display help

Verwandte Seiten