JSPM

astro-particles

2.9.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 136
  • Score
    100M100P100Q82598F
  • License MIT

Official tsParticles Astro Component - Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website. Ready to use components available also for Web Components, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, React.js, Riot.js, Solid.js, Inferno.

Package Exports

  • astro-particles

Readme

banner

astro-particles

npm npm GitHub Sponsors

Official tsParticles Astro component

Slack Discord Telegram

tsParticles Product Hunt

Installation

npm install astro-particles

or

yarn add astro-particles

How to use

---
import Particles from "astro-particles"
import type { ISourceOptions } from "@tsparticles/engine";

const options: ISourceOptions = {
    background: {
        color: "#000"
    },
    fullScreen: {
        zIndex: -1
    },
    particles: {
        number: {
            value: 100
        },
        move: {
            enable: true
        }
    }
};
---

<script>
    import { tsParticles } from "@tsparticles/engine";
    import { loadFull } from "tsparticles";

    (async () => {
        await loadFull(tsParticles);
    })();
</script>

<Particles id="tsparticles" options={options} />

Props

Prop Type Definition
id string The id of the element.
options object The options of the particles instance.
url string The remote options url, called using an AJAX request

particles.json

Find all configuration options here.

You can find sample json configurations here 📖

Demos

Preset demos can be found here

There's also a CodePen collection actively maintained and updated here

Report bugs and issues here

tsParticle Website