Web Design & UI/UX9 min read

Tooltip vs Popover: When to Use Each in UI Design

A tooltip names something and leaves on its own. A popover holds things to click and stays open. The one question that decides it, both patterns rebuilt, a decision table for ten cases and the HTML for each.

By Boone
XLinkedIn
Tooltip vs Popover: When to Use Each in UI Design

Tooltips and popovers are both small panels that float next to the thing that opened them, so they get swapped all the time. The difference is what people can do with them. Below: the question that decides it, both patterns rebuilt, a decision table and the code.

The one question: is there anything to click inside?

Look at what is in the panel. If it is only text that names or explains the control under the pointer, it can be a tooltip. If there is a link, a button, a checkbox or a text field in it, people have to move into the panel and use it, and that is a popover.

The W3C's tooltip pattern draws the line at focus. A tooltip never receives it, and a hover panel that contains focusable elements should be built as a non-modal dialog instead. The W3C marks that pattern as work in progress, but the line is easy to test with a keyboard.

The same fee note, both ways

Tooltip: one short line

An order summary where a dark tooltip above the service fee info icon reads Pays for card costs

Popover: title, detail and a link

The same order summary with a white popover titled Service fee, two lines of explanation, a How fees work link and a close button

Both are valid here. If one short line answers the question, the tooltip is enough. The moment the team wants a "How fees work" link, the component has to change, because a link needs a panel that stays put while people travel to it.

On a checkout, also ask whether the note should be hidden at all. If people need it to decide whether to pay, print it under the fee.

Tooltip: when it is right

A text editor toolbar of icon buttons with the pointer resting on one and a dark tooltip under it reading Add comment

A tooltip is right when:

  • It names an icon button. GitHub's Primer design system says to reserve tooltips for showing the label of an icon button.
  • It is a few words. A name, or a name and its keyboard shortcut.
  • Nothing in it is clickable. People read it and carry on.
  • Losing it costs nothing. It appears on hover or focus and disappears on Escape or when people move away.

Where it fails: anything people need in order to finish the task, anything they have to copy or click, and anything attached to plain text that a keyboard cannot reach. Primer rules out tooltips on non-interactive elements for that last reason.

Popover: when it is right

A calendar with a Design review event and a popover under it showing the day and time, a video call with 4 guests, Join call and Reschedule buttons and a delete icon

A popover is right when:

  • It holds actions. Join, reschedule, delete, copy a link, apply a filter.
  • It opens on purpose. A click, a tap or Enter on a button, never a passing pointer.
  • It stays open. People close it, press Escape or click outside it.
  • It needs structure. A title, a few lines, a small form.

Apple's guidelines call a popover a transient view that appears when people click or tap, and ask you to limit it to a few related tasks. Their own illustration is a calendar event whose date or time you can change without leaving the calendar.

Where it fails: long forms, warnings and decisions that must be made. Apple says not to use a popover for a warning, because people can miss it or close it by accident. A decision that blocks everything else belongs in a modal or a bottom sheet.

Wrong: a link inside a hover tooltip

An Export button with a dark tooltip below it holding a Change export settings link

Right: the link inside a popover

The same Export button with an open popover titled Export holding the Change export settings link and a close button

On the left, the link lives in a panel that depends on hover. A touch screen has no hover to give, and a tooltip never takes keyboard focus, so some people can see the link described and never reach it. On the right, a click opens the panel, focus can move into it and it waits.

Do not hide what people need

Wrong: password rules in a tooltip

A password field with a tooltip from an info icon listing at least 12 characters and at least one number

Right: password rules under the field

The same password field with the line At least 12 characters and one number printed under it

Sometimes the answer is neither. Nielsen Norman Group advises against tooltips for information that is vital to the task, and names field requirements as the kind of thing that should stay on screen. A popover does not fix that either. Print the rule next to the field, as in any well built form.

Tooltip vs popover, side by side

TooltipPopover
Opens onHover or keyboard focusClick, tap or Enter
Closes onMoving away, blur or EscapeClose button, Escape or a click outside
Takes focusNeverCan, and its controls are focusable
ContentA few words of textTitle, text, links, buttons, fields
JobName or explain a controlLet people see more and act
On touch screensNo hover to rely onOpens with a tap

Which one for common cases

SituationPickWhy
Naming an icon buttonTooltipA few words, nothing to click
Showing a keyboard shortcutTooltipExtra help that is fine to miss
Full text of a cut-off tab nameTooltipText only, read and move on
Share a page: invite and copy linkPopoverHolds a field and buttons
Calendar event details with JoinPopoverActions inside
Filter a table by statusPopoverControls people change
Fee explanation with a help linkPopoverA link has to be reachable
Password requirementsNeitherNeeded for the task, so keep it on screen
Confirm a permanent deleteNeitherA decision, so use a dialog
"Changes saved"NeitherA status message, so use a toast

What about phones?

Hover is a mouse habit. Nielsen Norman Group describes tooltips as mainly a desktop pattern, and its touch relative, the popup tip, opens on a tap and closes on a tap. So on a phone, give icons a visible label where you can, and put real content behind a tap. Apple goes further for iOS: avoid popovers in compact views and present the content in a full screen view such as a sheet.

Design systems do not all use the word the same way. Android's Material components have a plain tooltip for describing icon buttons and a rich tooltip that can carry a title, a link and buttons. By the rule here, that rich one behaves like a popover, so give it the open, focus and close behaviour of one.

Who draws the line where

  • Primer (GitHub) keeps tooltips for icon button labels and asks for minimal text.
  • Android's Material components use the plain tooltip to describe icon buttons and other elements.
  • Apple uses popovers for a small amount of information or functionality, one at a time.
  • Notion puts inviting people, access levels and the page link behind a Share button you select, not behind a hover.

The HTML for each

A tooltip that names an icon button:

html
<span class="tip"> <button type="button" aria-labelledby="tip-comment"> <svg aria-hidden="true"><!-- icon --></svg> </button> <span role="tooltip" id="tip-comment">Add comment</span> </span> <style> .tip { position: relative; display: inline-block; } .tip [role="tooltip"] { position: absolute; top: 100%; left: 0; white-space: nowrap; visibility: hidden; } .tip:hover [role="tooltip"], .tip:focus-within [role="tooltip"] { visibility: visible; } .tip[data-off] [role="tooltip"] { visibility: hidden; } </style> <script> const tip = document.querySelector(".tip"); document.addEventListener("keydown", (e) => { if (e.key === "Escape") tip.dataset.off = ""; }); ["mouseleave", "focusout"].forEach((n) => tip.addEventListener(n, () => delete tip.dataset.off)); </script>

WCAG 1.4.13 asks three things of content that appears on hover or focus: people can dismiss it, they can move the pointer onto it without it vanishing, and it stays until they leave, dismiss it or it stops being true. The script covers Escape, and keeping the tooltip flush against the button covers the pointer.

A popover needs no script to open and close:

html
<button type="button" popovertarget="fee">Service fee</button> <div id="fee" popover role="dialog" aria-labelledby="fee-title"> <h3 id="fee-title">Service fee</h3> <p>Pays for card costs and the support line on show nights.</p> <a href="/fees">How fees work</a> <button type="button" popovertarget="fee" popovertargetaction="hide">Close</button> </div>

With the default setting, MDN notes, it closes on Escape or a click outside, and popovers made this way are never modal. The attribute does not place the panel beside its button for you, so add CSS anchor positioning or a positioning library.

FAQ

What is the difference between a tooltip and a popover?

A tooltip is a few words that appear on hover or keyboard focus and cannot be clicked. A popover is a panel that opens on a click or tap, can hold links, buttons and forms, and stays open until dismissed.

When should I use a tooltip?

When you need to name an icon button or add a very short hint that is fine to miss.

When should I use a popover?

When the panel holds something to act on, or needs a title and more than a line of content.

It should not. A tooltip does not receive focus and depends on hover. Move the content into a popover.

Do tooltips work on mobile?

Not as a hover pattern, because touch screens have no pointer to rest on a control. Use visible labels, or open the content with a tap.

Is a popover the same as a modal?

No. A popover made with the HTML popover attribute is non-modal. A modal blocks the rest of the page until people deal with it.

Sources

More from Brainy Papers

Keep reading