-
Notifications
You must be signed in to change notification settings - Fork 53
[RFC] Tooltip - base component #1453
Comments
Let's also inspect AntDesign: |
Another example - Kendo UI library of Telerik, represents a set of components that come for cost: https://www.telerik.com/kendo-react-ui/components/tooltip/ . Their implementation strategy, essentially, follows the solution vector you've suggested in the RFC. |
The only remaining question is whether we want to allow actionable elements to be added inside the Tooltip. ARIA specifies that the Tooltip should not have focusable elements and this is followed by most of the Frameworks. AntDesign for example have two components the Tooltip - which doesn't support this, and the Popover - similar to our Popup which supports this. |
Agree with the focusable concern. Moving focus to inside of the tooltip is very tricky at least and might be confusing for the users (both keyboard and screen reader). Normal popup should be used for surfaces with focusable elements inside. There is a valid use case for such scenario - coach marks. We will investigate the accessibility side of it, but I think we should keep these scenarios separate. |
@jurokapsiar does this mean we won't have support to have a link inside a tooltip for now? |
If it was up to me, I would say we should never allow them in the tooltip scenario (we can have links in popups though). Let's discuss the usecases offline, I will then post the summary of the discussion here. |
@codepretty this is what was agreed offline: There are 3 different scenarios:
We are focusing on the within this issue. There might still be use cases when actionable elements might be put into the tooltip, we will review those use cases and come up with appropriate component representation. But that is outside of the scope of this issue. |
Feature Request
Problem description
We need a Tooltip component as part of Stardust, which is basically a popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it. It should follow the WAI-ARIA Tooltip Pattern
How other frameworks implement the Tooltip component
Material Design
The tooltip is implemented as a component which wraps the element associated with it. For example:
Semantic UI React
Do not implement dedicated Tooltip component, they are reusing the Popup on hover for the Tooltip scenarios.
Reakit
The recommended implementation is again in a form of component wrapping the element associated with the tooltip. Example:
Fabric UI
Again the Tooltip is implemented as a wrapper component (TooltipHost) which is appearing on hover/focus. Example:
React bootstrap
Here, there is an Overlay component, which is associated with the element via the target prop defined on it (they use ref for this).
Proposed solution
Following the common practices, we will add new Tooltip component, that will have the following API:
Common Stardust props
Custom component props
With this API the component will be similar to the Popup component, and it will be easy for the users to learn the new component's API.
With this API the component will be similar to the Popup component, and it will be easy for the users to learn the new component's API.
The text was updated successfully, but these errors were encountered: