DEV Community

Discussion on: Smarter Tooltips and Popovers with Popper 2

Collapse
 
panphora profile image
David Miranda

Hi, thank you for your amazing work!

I'm curious if Popper is a good fit for my project. I need a library that will position elements directly over other elements -- not beside them -- to create the illusion of an inline edit area.

Do you think Popper would be a good fit for this or not?

Collapse
 
fezvrasta profile image
Federico Zivolo

Take a look at the offset modifier, it can apply negative offsets to make the popper overlap with its reference element

Collapse
 
panphora profile image
David Miranda • Edited

So, the best way to get a popover to appear directly above an element would be to use the offset option as a function, as seen in the docs and use the reference element's dimensions to calculate the offset?

Thread Thread
 
fezvrasta profile image
Federico Zivolo

Yes, you'd do something like this:
codesandbox.io/s/epic-silence-i7680

Thread Thread
 
panphora profile image
David Miranda

Great, thank you!