Using tooltips without tooltip provider #2183
-
Hey team — I was wondering if using the Tooltip component without needing a global Tooltip Provider wrapper is possible. Our app is set up such that we have a few different ways that our pages can be wrapped in providers and we keep encountering whack-a-mole situations where tooltips will occasionally be used on a component that isn't nested in a global provider wrapper. Is it possible to use tooltips without the provider? Alternatively, is there a major drawback to simply including the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey Brian,
No, it isn't possible to use without the provider. The provider lets you configure things like timings globally for your app, but also manages the ability to move from an element with a tooltip to another one with another tooltip without having to incur the delay again.
If having a global provider isn't possible for your, then yes you may do this, wrap your implemention with the provider, everything will work except the latter point mentioned above, meaning if 2 buttons with tooltips are next to each other, the user will still have to wait for the second one to open even if the first is open already and they move quickly to it. Hope this helps. ✌️ |
Beta Was this translation helpful? Give feedback.
-
Hi @benoitgrelard I know this is an old discussion but I feel this is still something that wasn't completely answered. While I definitely understand the value of the Provider, I still can't understand why should it throw when not present, forcing us to wrap storybook, tests, and everything with a Provider that, in those cases, is pretty much inconsequential. If you feel that this is a design decision and shouldn't be changed in any way, at least you could expose the context for us to check in our implementation if there's a context available and wrap our Tooltip in its own provider if not. Would this be an acceptable change? |
Beta Was this translation helpful? Give feedback.
Hey Brian,
No, it isn't possible to use without the provider. The provider lets you configure things like timings globally for your app, but also manages the ability to move from an element with a tooltip to another one with another tooltip without having to incur the delay again.
If having a global provider isn't possible for your, then yes you may do this, wrap your implemention with the provider, everything will work except the latter point mentioned above,…