Home

Awesome

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 - React Component Node.js CI

tsParticles React component, using tsParticles.

Checkout the demo page.


Installation

npm install react-tsparticles

or

yarn add react-tsparticles

How to use

Code

Example:

import Particles from 'react-tsparticles';

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

}

Props

PropTypeDefinition
widthstringThe width of the canvas.
heightstringThe height of the canvas.
paramsobjectThe parameters of the particles instance.
styleobjectThe style of the canvas element.
classNamestringThe class name of the canvas wrapper.
canvasClassNamestringthe class name of the canvas.
containerobjectThe 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