wufe / react-particles-js

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

Can't able to place another elements inside particles component. #68

Closed nasr18 closed 5 years ago

nasr18 commented 5 years ago

I wanna place some components inside particles component. Whatever the elements i add inside particles, not at all displaying.

13it235 commented 5 years ago

I have a similar issue. I want to use particle js as my background. I am trying to render a button over it and it does not appear. If I enclose the particle js component and button inside a div tag, they are arranged one below the other.

wufe commented 5 years ago

As stated here (#16), the Particles elements does not accept children due its composition: it is a simple canvas. You can place components on top of the canvas by declaring its position to be absolute.

Check this example.

nasr18 commented 5 years ago

Yeah I fixed it by moving particles component to bottom. But my question is, why it's allowing other components placed below this component?

r33fyello commented 5 years ago

One way to do it example:


{children}
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.