/preact-particles

Preact tsParticles

Primary LanguageTypeScriptMIT LicenseMIT

This Repository has been moved!

This repository is now part of https://github.com/matteobruni/tsparticles, this repository will be archived because it's included in the main package tsParticles


tsParticles - Preact Component Node.js CI

tsParticles Preact component, using tsParticles.

Checkout the demo page.


Installation

npm install preact-particles

or

yarn add preact-particles

How to use

Code

Example:

import Particles from 'preact-particles';

class App extends Component{
  
    render(){
        return (
            <Particles />
        );
    };

}

Props

Prop Type Definition
width string The width of the canvas.
height string The height of the canvas.
params object The parameters of the particles instance.
style object The style of the canvas element.
className string The class name of the canvas wrapper.
canvasClassName string the class name of the canvas.
container object The instance of the particles container

Find your parameters configuration here.

Errors

If you have typescript errors tsParticles uses TypeScript 3.9.3 so try installing at least 3.8 for import type syntax.

Need More Help?

Slack