wufe / react-particles-js

Particles.js for React
https://rpj.bembi.dev/
MIT License
1.15k stars 106 forks source link

How to render components on top of the particles? #108

Closed SaavanNanavati closed 4 years ago

SaavanNanavati commented 4 years ago

I can't wrap child components in it for some reason

wufe commented 4 years ago

As a canvas cannot contain child DOM elements and to avoid messing up with css the component library itself does not allow for children elements to be rendered.

To place the component in background you should use style positioning.

Check the demo repository as it allows other components to be placed on top of the canvas.

matteobruni commented 4 years ago

@FrozenFury is this something similar of what you wanted to do?

https://codesandbox.io/s/react-login-on-particles-masking-background-ll9lh?file=/src/styles.css:0-130

SaavanNanavati commented 4 years ago

yes, thank you!