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
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
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.