airblade / headlessui-stimulus

Stimulus components for Headless UI
https://headlessui-stimulus.com
MIT License
16 stars 1 forks source link

Replace custom popover with `[popover]` once CSS anchor positioning available #6

Open airblade opened 6 months ago

airblade commented 6 months ago

https://developer.mozilla.org/en-US/docs/Web/API/Popover_API

The popover API is now supported everywhere. However CSS anchor positioning is not yet widely supported.

airblade commented 6 months ago

Or use the Popover API now and handle positioning with JavaScript.

HeadlessUI v2 has adopted Floating UI for positioning, so perhaps we could / should too.

See for example https://frontendmasters.com/blog/using-the-popover-api-for-html-tooltips/#the-positioning.