Using Floating UI in Vue.js

Today I used the @floating-ui/vue package to do some intelligent DOM positioning.

I wasn't getting any errors, but the library kept on positioning my floating element to {top: 0, left: 0}. After multiple hours I found out what I did wrong:

This is the way to go if you're using the setup hook or composition API. It might be different if you're using the options API.

Also: it's great that the library contains modules for vanilla JS, React and Vue. But some of their first-party plugins are only available for React. I wish they'd support all of their supported environments equally. HeadlessUI does this as well.