Tooltip Pattern
You'll learn how to create accessible tooltips that enhance information without trapping focus or confusing assistive technology users.
What Is an Accessible Tooltip?
A tooltip is a small popup that reveals supplementary information when you hover over or focus on an element. Unlike modals, tooltips should never trap focus or require interaction to dismiss. Think of them like sticky notes that appear when you need them and disappear just as easily—they're informational, not interactive.
The Core Challenge
Traditional tooltips often break for keyboard users and screen reader users. They might:
- Only appear on mouse hover (keyboard users miss them)
- Disappear when you try to read them with a screen reader
- Not be announced at all
- Contain interactive content (which shouldn't happen in a true tooltip)
Building It Right
The accessible pattern requires:
- Trigger on both hover AND focus so keyboard users see tooltips too
- Use
role="tooltip"on the popup element - Connect with
aria-describedbyon the trigger element (notaria-labelledby—tooltips supplement, they don't replace labels) - Dismissible with Escape key for keyboard users
- Brief, non-interactive content only—if users need to interact, use a popover or dialog instead
Tooltips work best for short hints like "Click to copy" on a button or defining an unfamiliar term. Screen readers typically announce the tooltip content when focus lands on the trigger element.
Key Takeaway: Accessible tooltips appear on both hover and focus, use role="tooltip" and aria-describedby, contain only static text, and dismiss easily without breaking the user's workflow.