Tooltip
On this page
Keyboard interactions
A tooltip will appear when the trigger receives focus and disappear when moving focus away from the trigger.
| Key | Result |
|---|---|
| Tab | Moves focus to the trigger, tooltip appears |
| Tab | Moves focus away from the trigger, tooltip disappears |
| Esc | Removes a tooltip without moving focus away from the trigger |
Additional guidelines
- Do not use a tooltip on static elements
- A tooltip should persist while hovering over the trigger and tooltip
- A tooltip should persist as long as the trigger has focus
- Users navigating via screen reader must have tooltip text announced to them when it is triggered
- If a tooltip is added to a disabled trigger, that trigger must be able to receive focus
Silent tooltips
If you add the silent attribute to an <rh-tooltip>, the content inside the tooltip is no longer accessible. Implementors should take special care when adding this attribute to:
- Implement accessible tooltip content by some other means:
aria-labelledbyaria-label- ARIA live region
- visually hidden text
- ...or other accessibility feature
- Test their custom implementation to make sure the tooltip content can be recognized by assistive technologies—especially screen readers.
To see an example of the silent attribute and how to implement it with accessible content, view the Silent demo. In that demo, the accessible-label attribute is added to <rh-icon> to make the tooltip content accessible to assistive technology.
It's exceedingly rare that users would need to use this attribute. Exercise caution when implementing and test extensively.
ARIA Authoring Practices Guide (APG)
Learn to use the accessibility semantics defined by the Accessible Rich Internet Application (ARIA) specification to create accessible web experiences.
Web Content Accessibility Guidelines
Understanding documents provide detailed explanations for Web Content Accessibility Guidelines (WCAG) guidelines and success criteria.
-
SC 2.1.1 Keyboard (Level A)
-
SC 2.1.3 Keyboard (no exception) (Level AAA)
-
SC 2.4.3 Focus order (Level A)
-
SC 2.5.5 Target size (Level AAA)
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.