2.0.1 • Published 3 years ago

reactparticles.js v2.0.1

Weekly downloads
85
License
MIT
Repository
github
Last release
3 years ago

reactparticles.js

Independently configurable React component for particles.js.

Overview

Plug-and-play particles into existing React projects using the same downloadable JSON configuration as the original particles.js. Configure multiple components independently using seperate JSON files.

Install

npm install reactparticles.js

Props

propdescriptiontyperequired
idunique identifierstringyes
configpath to particles configuration filestringno
stylestyles to add or override the defaultobjectno
classNameclass name to apply to the componentstringno

Default style

The following style is applied to each instance so it will automatically expand to its parent's height and width. This style can be overridden or expanded by passing an object with the values in as the style prop.

style: {
  position: "absolute" as "absolute",
  display: "block",
  top: "0",
  left: "0",
  height: "100%",
  width: "100%"
 }

Configuration

  • Customize and downloaded your config files from the particle.js site

  • Place the config file in your public folder and pass the config file path to your component.

Example use

Below I'm overwriting the default style width and height and adding a background color and opacity.

<Particles
  id="config-1"
  config="particles/config-1.json"
  style={{
    width: "50%",
    height: "50%",
    backgroundColor: "green",
    opacity: "0.5"
  }}
  className="particles-class-name"
/>
2.0.1

3 years ago

2.0.0

4 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago