-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create Tooltip component #3441
Conversation
Hello @brunohkbx, thanks for adding new component 🔥 I will answer your questions/comments in the upcoming days 🙌🏽 |
Hey @brunohkbx, thank you for your pull request 🤗. The documentation from this branch can be viewed here. |
The mobile version of example app from this branch is ready! You can see it here |
The mobile version of example app from this branch is ready! You can see it here |
The mobile version of example app from this branch is ready! You can see it here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @brunohkbx 🚀
Summary
This PR implements the Tooltip component described here in MD2 docs.
Tooltips display informative text when users hover over, focus on, or tap an element.
When activated, tooltips display a text label identifying an element, such as a description of its function.
This covers only the minimum functionality to make it usable. Desktop support and animated Transitions described in MD docs are not implemented. Future work can be done and is welcome to support all use cases.
Test plan
Behavior
A tooltip is displayed upon tapping and holding a screen element or component (on mobile) or hovering over it (desktop). Continuously display the tooltip as long as the user long-presses or hovers over the element.
Timing
Display the tooltip for 1.5 seconds. If the user takes another action before that time ends, the tooltip will disappear.
Placement
The tooltip can overflow to the left / right or bottom depending on where the wrapped element is placed on the screen.
The purpose of the following test cases is to show that the tooltip text does not goes offscreen.
Overflow To Left
![Test 1](https://user-images.githubusercontent.com/6487206/198193321-d656447d-1068-4e33-b47d-024b07a7d12a.jpeg)
Overflow To Right
![Test 2](https://user-images.githubusercontent.com/6487206/198193220-d8f0d3ea-ae81-40e7-8a2c-f76c9dcf747e.jpeg)
Overflow To Bottom
![Test 3](https://user-images.githubusercontent.com/6487206/198193416-598196c0-3674-49e7-897b-16e1ed2b0a2c.jpeg)
Normal placement
![Test 4](https://user-images.githubusercontent.com/6487206/198193668-e5695bf9-09b8-44fc-b8ee-52845a3e0026.jpeg)