What is a tooltip?
also known ashover hint · info tip · label balloon
A tooltip is a small floating label that appears when you hover or focus on an element, explaining what an icon, button or shortened text means.
Made ofA short text label shown on hover and keyboard focus, tied to its trigger with aria-describedby.
position: absolutebottom: 100%pointer-events: nonez-index: 60You hover over a toolbar icon you have never seen before. It might be a paperclip, it might be a pin, it might be a thing that deletes your afternoon. You wait half a second and a small dark label appears: Attach file. Relief. That label is a tooltip, and its whole job is to answer a tiny question at exactly the moment you ask it.
A tooltip is a short, transient piece of text attached to an element. It usually has a dark background, light text and a little arrow pointing at its source. It appears when the pointer rests on the element or when the element receives keyboard focus, and it disappears when the pointer leaves or the user presses Escape. Its typical contents are the name of an icon-only button, the full version of text that has been cut off, or a keyboard shortcut shown in a small chip.
The key word is supplementary. A tooltip can clarify something, but it should never be the only place where important information lives. Touch devices have no hover, so many people will never see it, and keyboard users only see it if the element is focusable and the tooltip responds to focus. That rules out critical instructions, error messages and legal text. If something has to be read, put it on the page.
Timing matters more than most people expect. Show a tooltip instantly and it flickers as the cursor crosses a toolbar, flashing labels like a slot machine. Delay it by roughly 200 to 500 milliseconds so it only appears when the user pauses. Once one tooltip is open, a short grace period lets neighbouring items show theirs quickly, which makes scanning a toolbar feel smooth. The tooltip should also stay put when the pointer moves onto it, because the Web Content Accessibility Guidelines expect hover and focus content to be dismissible, hoverable and persistent (success criterion 1.4.13). People using magnification often need to move onto the tip to read it.
Tooltips are different from popovers. A tooltip holds a few words and no controls. A popover is larger, may contain links, forms or buttons, and opens on a click. If your tooltip needs an interactive element, it was a popover all along.
Some best practices:
- Keep the text to roughly one to six words.
- Trigger on both hover and focus, and close on Escape.
- Connect the tooltip to its element with aria-describedby, and give it role=tooltip.
- Avoid relying on the native title attribute, which is slow, unstyled and inconsistent on touch.
- Position it so it never covers the control it describes, and flip it when it would overflow the viewport.
- Give icon-only buttons an accessible name as well. A tooltip is not a substitute for a label.
- Show shortcuts in a styled chip, such as Cmd and S, next to the action name.
For AI prompts, specify the behaviour. Ask for a tooltip with a 300ms open delay, focus and hover triggers, Escape to dismiss, an arrow, collision-aware placement and aria-describedby wiring. Mention that it should be text only. A vague request often yields a CSS-only hover box that nobody on a keyboard can reach.
- Icon-only buttons that need a text label
- Truncated text where the full string is useful on hover
- Keyboard shortcut hints (`⌘S = Save`)
- Form field clarifications next to a `?` icon
- Critical instructions, make them visible inline
- Touch-first products, there's no hover
- Long explanations, use a popover or inline help instead
- +Delay appearance by 200–500ms to avoid flicker
- +Trigger on focus too, not just hover, for keyboard accessibility
- +Keep content under 6 words when possible
- +Show the keyboard shortcut as a styled chip inside the tooltip
- −Don't put interactive elements (buttons, links) inside a tooltip, use a popover
- −Don't show tooltips on touch devices via long-press unless it's discoverable
Tooltip: your questions, answered
What is a tooltip in UI design?
A tooltip is a small floating label that appears when a user hovers over or focuses on an element. It explains an icon-only button, shows the full text of a truncated label or reveals a keyboard shortcut. It is meant for short, nice-to-have clarifications, not essential information.
What is the difference between a tooltip and a popover?
A tooltip is tiny, text-only and non-interactive, and it appears on hover or focus. A popover is larger, can contain links, forms and buttons, opens on click and stays until dismissed. If you need to put something clickable inside, you need a popover.
How long should a tooltip delay be?
Around 200 to 500 milliseconds before it appears. That prevents flicker when the pointer crosses several elements. After one tooltip has opened, a short grace period for neighbours feels smoother. Hide it quickly when the pointer leaves or focus moves.
Are tooltips accessible?
They can be, if they appear on keyboard focus as well as hover, close with Escape, stay visible while the pointer is over them and are linked with aria-describedby. They still do not work on touch, so never hide essential information in one.
How long should tooltip text be?
Keep it to one to six words wherever possible, such as Save draft or Copy link. If you need a full sentence, use inline help text or a popover. A tooltip that reads like a paragraph defeats its own purpose.
More quick answers
Do tooltips work on mobile?
Not really, as there is no hover. Show labels directly, use visible text next to icons, or offer help in a tap-triggered popover.
Should I use the HTML title attribute for tooltips?
Avoid it for anything important. It has a long, uncontrollable delay, cannot be styled and is poorly supported by touch and some assistive tools.
What is the WCAG rule for tooltips?
Success criterion 1.4.13 says content shown on hover or focus must be dismissible, hoverable and persistent until dismissed or no longer relevant.
Tooltip vs toast: what is the difference?
A tooltip explains an element when you ask. A toast reports something that happened after an action, without being asked.
Where can I show keyboard shortcuts?
In the tooltip, next to the action name, and in a command palette where actions are searchable and each result can show its own shortcut.
Found this useful? A GitHub star helps other designers find it.