Tour: place the step tooltip over the center of its target #9368
ReemX
started this conversation in
Feature requests
Replies: 1 comment
|
Thanks for the suggestion! This is distinct from #9367, and you’re welcome to submit a PR with this feature. The |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, and thanks for the Tour component. We use it for onboarding tours across our apps.
One case we keep running into: a step whose target has no room for the tooltip on any side, like a panel that fills most of the screen or a long list of cards. With
crossAxisshift (#9367) the tooltip at least stays on screen, but it lands on the target's edge in a fairly random spot. For these steps it reads much better when the tooltip sits in the middle of the target, over it.Right now we get this by patching
use-tourto switch a step to placementbottomwith a negative offset of half the target height plus half the tooltip height, and to dropflipfor that step:Would you be open to supporting this in Tour? Two shapes that would both work for us:
position="center"seemed the most natural to me: steps without a target are already centered on the screen, so this is the same idea relative to the target. It would be a Tour-only type (FloatingPosition | 'center'), the sharedFloatingPositionwould not change. The spotlight and overlay stay as they are.I have this working on a branch (the
position="center"version), with a test, a step in the position demo and a sentence in the docs. Happy to open a PR in whichever shape you prefer.Thanks!
All reactions