herrethan/react-confetti-explosion

Position relative to its parent

Closed this issue · 1 comments

Guess it's using window.w/h for rendering like other confetti libs, but it's obvious to have a control of the position. (from Where the canvas is located)

I can position it, but the results are like below
Screenshot 2023-03-27 at 11 13 47 AM

@softmarshmallow it does not use window w/h for rendering (and also does not use canvas), it renders a 0x0 <div> relatively inline, which the portal is then generated off of. So you could wrap <ConfettiExplosion /> in your own positioning element or add styles to the component itself to position, ie:
<ConfettiExplosion style={{ left: 20, top: 20 }} />.

What typically causes what we see above is your height prop being smaller than the viewport height. Are you seeing another case where that occurs?