Popover implementation #37
Replies: 4 comments 8 replies
-
So on the Web side I’d want to use Radix, and on native, ideally some sort of native library like this: https://github.com/dominicstop/react-native-ios-popover This is how Zeego currently works |
Beta Was this translation helpful? Give feedback.
-
I understand this sentiment. But I've been down this road before, so I have some biases. https://twitter.com/FernandoTheRojo/status/1368981343460331530?s=20 All I can say is, my assumption is that you'll eventually land at the same conclusion: it's better to use native UI primitives. If you open a custom menu on iOS, and then try to scroll behind it, does the menu close with a nice animation and the scroll view still work? or does it just sit there stuck and force someone to tap the background? Little things like this compound to a poor UX that feels "React Native"-y. At this point, I don't believe in rebuilding native primitives that are low-level using JS. I've never seen a popover or bottom sheet built with JS that feels like it would be in the GitHub or Airbnb iOS apps. With all that said, obviously the top goal is just to ship. If using a Floating UI-like experience works for you, definitely go for it. But I plan on using Zeego / Burnt as ways to bring native primitives into JS land. |
Beta Was this translation helpful? Give feedback.
-
Hey @nandorojo , for popovers this might be a good approach: https://github.com/alantoa/universal-tooltip/ |
Beta Was this translation helpful? Give feedback.
-
https://github.com/aheze/Popovers this looks promising |
Beta Was this translation helpful? Give feedback.
-
Here's a simple headless Popover implementation.
Compound Component
Usage
Web screenshot
iPhone screenshot
This isn't as nice as FloatingUI or anything, but it's a start.
Let me know if I'm on the right track or if I'm overlooking something before I go much further on it. I'm not super familiar with the RNW ecosystem or if I'm causing massive perf problems. 😬
Beta Was this translation helpful? Give feedback.
All reactions