element-hq / compound

Element's design system
https://compound.element.io
Apache License 2.0
12 stars 3 forks source link

Investigation: Switch to a non-Radix solution for tooltips? #298

Closed robintown closed 5 months ago

robintown commented 10 months ago

@t3chguy's efforts to start using the Compound Web tooltip component in more places across Element Web are running into a number of roadblocks due to quirks of the Radix-based implementation:

As a result, I've begun looking into alternative component libraries that we could build our tooltip component on, in case one of them gives us an obviously easier way to move this task forward. Currently, the only other mature, unstyled React component libraries than I'm aware of are React Aria and MUI Base UI.

I have yet to investigate MUI Base UI. If that doesn't work out though, we should reconsider whether there's a way forward that still uses Radix. Implementing a tooltip component from scratch is also on the table, but I would really like to avoid this.

robintown commented 9 months ago

Another option: Floating UI

On first glance this looks really promising! It's all based on hooks rather than components, which would allow us to keep our React trees shallow, and the package includes hooks for menus, which could be an interesting alternative to Radix menus in the future as well. I say this because Radix menus have turned out to be a little inflexible when it comes to keyboard focus of custom menu elements.

florianduros commented 5 months ago

@robintown Can you close the issue ? It was done in https://github.com/element-hq/compound-web/pull/156 Thanks!

(I don't have the rights in this repo)