Information, interaction, and the anchor. The two small surfaces that float beside the thing they belong to: one names it and leaves, the other holds controls and stays. Where they sit, when they open, how they close, and the line between them.
A tooltip is information: a line of text that names or explains its anchor, opened by hover or focus, never focused itself, gone when attention moves. A popover is interaction: a surface opened by a click that holds controls, takes focus when it has something to focus, and stays until it is dismissed. Every failure in this chapter is one of them doing the other's job.
The two look alike. Both are small, both float at level 2, both hang off an anchor by a few pixels, and many libraries build them on the same positioning code, which is how the confusion gets into products. The test that separates them is not size or styling but what the user can do with the content. If there is nothing in it to operate, it is a tooltip. If there is anything in it to operate (a link, a button, a field, a list to choose from), it is a popover, and it has to open on a click, because only a click gives the keyboard, the touch screen, and the pointer the same way in and a stable surface to work in. The four panels below are the ways products cross that line, drawn at full size in an invented ferry operator's timetable office.
The fare table is a destination, so this is a popover's content. Focus stays on the icon, so a keyboard user can't reach the link, and the pointer has to make the trip to it while the tooltip is free to close.
The pointer leaves the trigger to reach the menu and spends a few frames over the page, where nothing is hovered. A diagonal path to the second item crosses "Vessels" and opens a different menu.
The one place users most want an explanation is the one place a tooltip can't appear. A disabled button gets no pointer events in most browsers and never takes focus, so the reason is unreachable by every input.
The button already says Export. The tooltip says it again, 400ms later, over whatever was above the button. A tooltip earns its place by adding what the anchor can't show: a name for an icon, a shortcut, a reason.
The first two are the same mistake from opposite ends: content that needs a click, opened by hover. Carbon says it flatly, "do not include interactive elements within a tooltip," because tooltips don't receive focus, and sends that content to its toggletip, a popover opened on click. The WAI-ARIA tooltip pattern says the same from the other side: tooltips do not receive focus, and something hover-opened that contains focusable elements is a non-modal dialog. The third is the disabled-control problem, and its fix belongs to the control: make the button focusable but inert (aria-disabled="true" instead of disabled) so it can carry a tooltip, or, better, put the reason in visible helper text where nobody has to hunt for it. The fourth is a content failure, and the cure is to delete the tooltip.
| Tooltip | Popover | |
|---|---|---|
| Job | Names or explains its anchor | Holds controls or content the user works with |
| Opens on | Hover after a delay; keyboard focus at once | Click, Enter, or Space on the anchor |
| Content | Text: a label, a shortcut, up to a title and two lines | Menus, forms, details, pickers; anything focusable |
| Closes on | Pointer leaving anchor and tooltip; blur; Escape | Click outside, Escape, the anchor again, or completing the task |
| Focus | Never moves; stays on the anchor | Moves in if there is something to focus; returns to the anchor on close |
| Semantics | role="tooltip" · aria-describedby | popover · aria-expanded · aria-controls |
| Touch | None; it doesn't exist on touch | Same as click |
| Layer | level 2 · z-tooltip 1400 | level 2 · z-popover 1000, or the top layer |
The boundaries, stated once. Elevation I gave both surfaces their level and their layer, and Elevation II their material, which is opaque. Border I gave the tooltip radius sm 4 and the popover md 8, and the hairline. Motion I §IX gave their entrances and exits and left the tooltip's delay to this chapter. Select I §VIII settled the listbox under its trigger; this chapter generalises that to every anchor. Overlays: Modal & Drawer (planned) owns anything that blocks the page, and Navigation owns the menu bar. What is left belongs here: which of the two a piece of content needs, where it sits, when it opens, and how it closes.
A tooltip is one line of 12/16 text on a dark surface, 6px by 8px of inset, radius 4, 28px tall, 240px at most, and no arrow. A popover is an opaque white surface with the hairline and level 2's shadow, radius 8, 16px of inset, a 13/600 title, a 13/400 body, and its actions at the end of a footer. Both are built from tokens other chapters already set; what this chapter adds is the composition.
The tooltip is the smallest surface in the system and should look it. Its text is text-sm, 12/16 at 400, the helper voice from Type I §III, one step under the UI voice of the controls it describes, so it never competes with them. Six pixels above and below a 16px line makes 28px, the height of a compact control, and 8px at the sides keeps the text off the corners. The surface is the page's darkest ink, #1a1a1a with #fafaf8 text at 16.7:1, which is the convention every major system uses for a plain tooltip because it separates the tooltip from every white surface it can cover, including the popover it may sit on. The radius is sm 4, the control step, since a tooltip is sized like a control; at 8 a 28px box starts to read as a pill.
The popover is a small container. It is opaque white with the 1px hairline at .10 and level 2's key + ambient shadow, which together say "above the page" without a scrim; translucency is refused here as everywhere, because a popover is read and operated, and a hint of the table under it is noise under its labels. The radius is md 8, the container step, so a popover's corners are visibly rounder than the 4px controls inside it, which is the nesting rule for corners working as intended. The inset is 16 on every side for content popovers; a menu takes 4 around its rows instead, and the rows carry their own 8 (section IX). The title is the one emphasis at the UI voice, 13/600, with the body at 13/400 directly beneath; a popover that needs a 16px heading needs a dialog. Footer actions sit at the end, the primary last, matching the dialog's order, so a user who has learned one has learned both.
A tooltip wraps at 240px. At 12px, DM Sans averages about 0.45em per character (measured on this page), so the 224px of text box inside the inset holds roughly 40 characters a line, half the reading measure. That is deliberate: a tooltip is read in one glance, and a short line is what makes it one. Without a cap, a tooltip with a sentence in it becomes a 500px strip that covers half a toolbar and can only be read by moving the eye across it.
No arrow. An arrow is optional on a tooltip and never drawn on a popover. A tooltip 4px from a 28px icon has no ambiguity to resolve, so most tooltips don't need one; where a team wants it, it is 8px wide and 4px deep and points at the anchor's centre, not the tooltip's, so it stays true when the tooltip has been shifted along the edge (section IV). A popover has a stronger cue than an arrow: its edge sits on the anchor's edge (section III). An arrow also forces a centred placement to look right, and centring is wrong for most popover anchors. Apple's HIG draws an arrow on every popover; on a platform whose popovers float free of a toolbar's grid that is reasonable, and on the web, where popovers drop out of the same edge as the control, alignment does the job with less ink. Carbon makes the caret optional on its popover for the same reason.
Hang a tooltip 4px from its anchor and a popover 8px, and align each to the anchor by the edge the anchor offers: a popover from a text button or a field starts on the anchor's start edge; anything from an icon button is centred on it; a listbox from a field also matches the field's width. The gap says "separate surface"; the alignment says "from this one." Both have to be exact, because the eye reads a 6px miss as a mistake rather than as a choice.
The gap is 4 for a tooltip and 8 for a popover. Four is the smallest distance that still reads as a gap at 1x, and a tooltip should sit as close as possible to the thing it names: at 8 a tooltip in a dense toolbar starts to look as if it belongs to the button above. A popover is bigger and heavier and carries a shadow whose key layer is 3px deep, so at 4 the shadow touches the anchor and the two read as one object; at 8 it reads as a surface that came out of the button, which is what Select I concluded for the listbox, here applied to every popover. A popover fused to its anchor at 0 reads as the anchor growing, which is the right look for an accordion and the wrong one for anything floating above the page. Both numbers are steps of the 4px base unit, and both are measured from the anchor's visible edge, its border box, not from an invisible hit area around it.
The alignment follows the anchor's shape. A text button and a field have a start edge the eye already follows down the toolbar or the form, so the popover continues that edge: the rail carries on through the overlay. An icon button is 28px square and has no edge worth following; centring is the only alignment its shape offers, and a menu start-aligned to a 28px icon hangs off to one side and looks dropped. A field's listbox also takes the field's width, because it is the field's list of values; a narrower one looks like a different control, and a wider one is allowed only when options would otherwise truncate (Select I). All three rules give way to collision, which is the next section, and the first thing collision does is try the same alignment from the other side.
Place a tooltip above its anchor and a popover below it, start-aligned; when that doesn't fit, flip, first the alignment and then the side; if neither flip fits, shift along the edge by the least distance that does; and if the surface is still too tall, shorten it and scroll inside. Two rules hold through all of it: the surface never covers its anchor, and never leaves the viewport. The industry converged on this order because each step keeps more of the relationship than the next one does.
Flip before shift, because a flip keeps the alignment and a shift gives it up. The menu at the top right can't start on the button's start edge without running off the screen, so it ends on the button's end edge instead: the same relationship, mirrored. Only when both alignments and both sides fail does the surface slide along the edge, and then by the minimum, so it stays as close to aligned as the viewport allows; the tooltip at the bottom right moved 28px and no further. Never cover the anchor: a popover pushed back into the viewport over its own trigger hides the thing that explains it and the thing that closes it, which Apple's HIG also asks platforms to avoid. If a flipped popover is still too tall for the space on its side, it shortens to the space available and scrolls inside, keeping its gap. Keep 8px from the viewport's edge in every case, so no surface ever touches the window's frame; that padding is what the collision math measures against.
Two implementations exist, and both say the same thing. Floating UI, which underlies most React libraries (Radix and shadcn/ui among them), runs the order as a chain of middleware: offset, flip, shift, size. The platform's own CSS anchor positioning tethers the surface to a named anchor and tries a list of fallback positions in order, with no script and no measuring on scroll. It flips; it doesn't yet shift, so the tooltip that slides along an edge still needs the library where the native API is the only tool.
One placement is fixed in advance and never flips: a tooltip on a control inside a toolbar at the top of the window goes below, always, because "above" is the browser's chrome. Write that as the default for the frame's top bar, not as a collision every hover has to discover; the tooltip won't jump between sides from one button to the next. Item-aligned placement, where the listbox opens over its trigger with the current value on top of it, is the one sanctioned exception to "never cover the anchor," and it is a listbox's choice, made in Select I, not a popover's.
Show a tooltip after 400ms of hover; once one is showing, show the next one in the same group at 0ms, and keep that warm state for 300ms after the last one closes. Show it at once on keyboard focus. Hide it the moment the pointer leaves both the anchor and the tooltip, when the anchor loses focus, or on Escape. Never show one on touch. The delay is the whole difference between a tooltip that helps and one that flickers.
Each number answers a different failure. The first delay is there because the pointer crosses toolbars on its way to other things, and a tooltip that fires on every pass is a strobe; it also gives a user who knows the icon time to click before anything covers the screen. Under about 300ms tooltips fire in transit. Over about 600ms the user who wanted the label has started to wonder whether there is one. Radix ships 700ms as its default; this series takes 400, the middle of the useful range, because a product's tooltips are mostly icon names, and an icon name is wanted quickly or not at all. The warm state is the reason a delay is tolerable: once the user has shown they're reading tooltips, scanning along the toolbar should cost nothing, so the next tooltip appears immediately. Radix calls the window skipDelayDuration and defaults it to 300ms, which is the number here. Keyboard focus shows the tooltip at once, because a Tab is a deliberate act with no transit to filter out.
WCAG 1.4.13 sets three conditions for anything that appears on hover or focus, and each one is a tooltip rule. Dismissible: Escape closes it without moving the pointer or the focus, so a tooltip covering what the user is reading can be put away. Hoverable: the pointer can move from the anchor onto the tooltip without it closing, which means the 4px gap is bridged by an invisible extension of the tooltip's hit area, and "leaves" means leaves both. Persistent: it stays until one of those things happens, never on a timer. A tooltip that fades after three seconds was written for someone who reads at the designer's pace. The ARIA tooltip pattern adds the wiring: the anchor references the tooltip with aria-describedby, focus never moves into it, and it closes when the anchor loses focus.
Touch has no tooltips. There is no hover, a long-press belongs to the platform (selection, context menus, drag), and a tooltip on tap would steal the tap from the button. So nothing a touch user needs can live only in a tooltip, which is the strongest argument for the rule in section I: icon names on touch layouts are visible labels or accessible names, and reasons a control is unavailable are visible text. Gate tooltip behaviour on @media (hover: hover), or on the pointer type of the event that would open it.
A popover closes on a click outside it, on Escape, on a second click of its anchor, and when its task is done; a close button may be added, but a popover that closes only with one is wrong. Focus moves into the popover when it holds something to focus and returns to the anchor when it closes by keyboard. No scrim, no focus trap: a popover doesn't block the page, so the page has to stay one click away.
Light dismiss is the default because the popover isn't modal. The page behind it is live, so a click on it means the user has moved on, and the popover should go rather than make them aim for a corner first. Apple's HIG states the same rule: a popover closes when people click or tap outside it, and a close button belongs only where it adds clarity, such as leaving with or without saving. The same page names the cost: a stray click can dismiss a popover by accident, so light dismiss must never lose work. A filter popover keeps its unapplied choices until it next opens, or applies them as they change. When closing would discard input that matters, the content has outgrown the popover: it needs a dialog, which blocks, traps focus, and asks before discarding (Overlays: Modal & Drawer, planned).
Focus goes in only if there is somewhere to go. A filter, a form, a picker, or a menu takes focus on open, on its first control, or for a menu its first item, per the menu button pattern. A popover of plain detail keeps focus on its anchor, the disclosure pattern with the content placed right after the button so the next Tab reads it. Focus is never trapped: Tab past the last control leaves the popover, and it closes behind the user. The anchor carries aria-expanded throughout, and a second click or Enter on it closes what it opened.
The platform now does most of this. An element with the popover attribute, opened by a button with popovertarget, gets light dismiss, Escape, the toggle from its button, the top layer (so no ancestor can clip or out-stack it), and closes any other open popover that isn't its ancestor, which is "one popover at a time" for free. A popover="manual" surface opts out of light dismiss and is the wrong default for exactly the reason the second specimen shows. The newer popover="hint" state is meant for tooltip-like surfaces that open beside an open popover without closing it.
A tooltip fades in at fast after its delay and out at snap, with no movement; a popover fades in at fast while travelling 4px out of its anchor's side, and fades out in place at snap. Both are Motion I §IX's numbers. What this chapter adds is why the tooltip doesn't move at all.
The tooltip doesn't move because the pointer isn't moving. A tooltip appears after the user has stopped, under or beside a cursor that is at rest, and any travel at that moment reads as the tooltip approaching the pointer. In the warm state tooltips also replace each other at 0ms as the pointer slides along a toolbar, and with movement each swap would become a small ripple. A fade is enough to say "this appeared," and the delay has already said "because you waited." The popover moves 4px because it came from somewhere: it drops out of its anchor's side (down when below, up when flipped above) and that short travel ties it to the button that opened it. A scale from .96 with its transform-origin on the anchor's side is an acceptable alternative and is what several libraries ship; a scale from the surface's own centre is not, because it grows out of nothing in particular.
Both exits fade in place at snap, one step down from the enter, since nobody watches a surface they've finished with. Both animate only opacity and transform, the compositor-only pair; the shadow arrives with the surface at full strength, never growing (Elevation II §IV), and nothing animates top, left, or size, which also means a popover that flips sides between openings never animates the flip. Under reduced motion the 4px goes to zero and both surfaces cross-fade in place, with the tooltip's delay unchanged, since the delay is timing, not motion.
| Surface | Delay | Enter | Exit | Movement |
|---|---|---|---|---|
| Tooltip | 400 · 0 warm | fast · ease-enter | snap · ease-exit | Opacity only |
| Popover, menu | 0 | fast · ease-enter | snap · ease-exit | Opacity + 4px from the anchor's side; out in place |
| Hover card | 500 | fast · ease-enter | snap · ease-exit | As a popover |
| Reduced motion | unchanged | unchanged | unchanged | Distance 0; opacity only |
A tooltip may hold a label, a keyboard shortcut, and at most a title line over two lines of text. It never holds an image, a link, or a control. Past that line it is a popover, opened by a click, and when the content is help about a field or a figure, the click target is a small "i" button made for it.
The shortcut is the best thing a tooltip can add. An icon's tooltip is where users learn the keyboard, so put the shortcut there, trailing, in IBM Plex Mono at 11px, the mono voice, in a muted ink that still clears 4.5:1 on the dark surface (#a8a8a4 measures 7.3:1 on #1a1a1a). It sits 12px after the label, three base units, which is wide enough to read as a separate field and narrow enough to stay one line. Use the platform's glyphs (⌘ ⇧ ⌥ on a Mac, Ctrl+Shift elsewhere), never both. A title line, in the same 12px at 600, is allowed when the tooltip explains rather than names: a metric, a column header, a status. Under it, two lines of body is the ceiling, because that is what can be read at a glance before the pointer moves on; a third line means the content is documentation, and documentation belongs on a page or in a popover that waits for the reader.
An image, a link, or a button makes it a popover, whatever the component is called. Some systems ship a "rich tooltip" with an action in it; by this chapter's test that is a popover with a tooltip's styling, and it needs a popover's click, focus, and dismissal or it fails the user who arrives by keyboard. Carbon's toggletip is the clean version of the fix: the same small surface, opened on click or Enter from an "i" button, staying open until dismissed, allowed to contain links and buttons. The "i" button is a real button, 20px drawn inside a 24px target, with an accessible name that says what it explains ("About peak fares"), not "info."
Every popover is one of four things, and the class sets its width, its inset, and its focus: a menu of actions, a form of a few fields with Apply, a detail card about a person or record, or a picker for one value. A popover that is two of these at once, or that commits something irreversible, has outgrown the class and the surface.
Menu. A list of actions on its anchor's object, 32px rows inside a 4px inset, text 12px inside the hairline, at least as wide as its anchor and as wide as its longest item. It takes focus on its first item and moves with the arrow keys (the menu button pattern); it closes when an item is chosen. A menu of values rather than actions is a listbox and belongs to Select I; a menu bar belongs to Navigation. A menu holds routine actions. A destructive one is better left to the record's own screen; if it must be in the menu, it goes last, after a separator, ends in an ellipsis, and opens a confirmation dialog rather than acting. Form. Two or three fields that change a view: a filter, a sort with options, a column chooser. 280 wide, 16 in, Apply as the one primary at the end and a quiet Clear beside it. Everything it does is reversible, which is what makes light dismiss safe.
A commit doesn't belong in a popover. The fifth panel saves a reschedule that notifies 1,240 people, from a surface built to vanish when the user clicks the page behind it, with nothing between the click and the consequence. Irreversible actions stand apart: they go in a dialog that blocks, states the consequence, and asks for a confirmation, the rule Grid II §V wrote for layout and every chapter since inherits. Detail. A card about a person, a vessel, a record, 300 to 320 wide, read rather than operated, so focus stays on the anchor. It opens on click on desktop. The one hover exception is the hover card on a name or a link, which shadcn/ui describes as a preview "for sighted users": it is allowed only if it waits 500ms, a step longer than a tooltip because it is a much larger surface to throw over the page, and holds nothing to operate. Put two buttons in it, as the last panel does, and it fails section I's rule from the other side. Picker. One value chosen from a structure, a date or a colour, sized by its grid; its anatomy is Date & Time's and its anchor rule is the field's: start-aligned, focus into the grid on the selected value.
| Class | Width | Inset | Focus on open | Closes when |
|---|---|---|---|---|
| Menu | ≥ anchor, by content | 4 · rows 32 | First item | An item is chosen; outside; Escape |
| Form | 280 | 16 | First field | Apply; outside (choices kept); Escape |
| Detail | 300–320 | 16 | Stays on the anchor | Outside; Escape; anchor again |
| Picker | From its grid | 16 | The selected value | A value is chosen; outside; Escape |
Open popovers and tooltips in the browser's top layer, so whatever opened them, including a modal dialog, they paint above it; the z-index scale is the fallback for stacks the top layer can't reach. The scale's order still states the intent: a tooltip at 1400 is above everything, and a popover at 1000 is below a modal at 1200, which is exactly wrong for a popover opened from inside that modal.
The scale was written for a page, and a modal is a second page. Elevation I §VII ordered the layers by what must win on the page: popovers above content, drawers and dialogs above popovers, so a dialog opening covers any menu left open, which is right. But a popover opened from the dialog is part of the dialog, and on the popover layer it paints underneath it. There are two fixes, and one is better. The top layer: a surface opened with the popover attribute, like a dialog opened with showModal(), joins the top layer in the order it was opened, so anything opened from the dialog paints after the dialog without any number at all. A stacking context inside the dialog: render the popover as a child of the dialog with a local z-index, or portal it into the dialog's own container, so the dialog's context carries it up. The first needs no bookkeeping and can't be clipped by the dialog's overflow; the second is the fallback for libraries that portal to the body. Never solve it by raising --z-popover above the modal: then every menu left open on the page paints over the next dialog.
A tooltip always wins, which is why it has the top of the scale and is the one deliberate mismatch between level and layer: level 2's shadow, layer 1400. A tooltip on a control inside a popover, a dialog, or a toast must never be covered by the surface it explains, and in the top layer it achieves the same thing by opening last. The one thing a tooltip must not cover is another popover's anchor that the pointer is about to reach, which is the practical reason for its 240px cap.
In dark mode the tooltip stays a dark surface, one step from the top of the ramp, #363636 with #ecebe8 ink and a white hairline; it does not invert to a light chip. The popover climbs the ramp to level 2's #282828 and leans on its hairline, because shadows barely register on a dark page. Both keep their weights and sizes; only the inks change, as Type III §VIII settled for all text.
Why not invert. In light mode the tooltip is the darkest surface on a light page, a strong but small contrast that says "transient." Inverting it in dark mode to keep "the opposite of the page" produces a near-white chip on a near-black screen: at 15.7:1 against the canvas it is the brightest object anywhere, brighter than any primary button, and on a dark screen the brightest small object reads as an alert, a toast, or a selection. The tooltip's job is to be quiet. The right move keeps it dark and lifts it to #363636, the top of the dark ramp, so it sits above every surface it can cover, including a #282828 popover, with a white hairline at .14 to draw its edge where the luminance step alone (1.55:1 on the canvas, 1.22:1 on a popover) is too slight. Its ink is the dark primary, #ecebe8 at 10.1:1, and the shortcut's muted #b0b0ae still clears 4.5:1 at 5.6:1.
The popover climbs the ramp to level 2's surface, #282828, with the top edge brighter than the sides, exactly Elevation II §IX's opaque material in the dark. It stays opaque; a translucent dark popover lets bright text from the page bleed through under its labels, which is worse in dark mode than in light. Its body text takes the dark primary at 12.4:1 and its muted text #b0b0ae at 6.8:1. The primary button inside flips to the light fill, as primaries do in dark mode, so the popover still has exactly one loud thing in it.
Decide each overlay in this order, once per component; each step assumes the ones before it.
Steps one and nine are the judgement; the rest are contracts written once and inherited by every overlay in the product. The audit is short: hover every icon in a toolbar and count the ones with no tooltip or a tooltip that repeats the label; Tab through the same toolbar and count the tooltips that don't appear; open every popover and click the page behind it; open every popover near each edge of a small window; open a select inside a dialog. Each failure found that way is one of this chapter's sections.
Overlays: Modal & Drawer (planned) takes everything that blocks: the dialog a commit belongs in, the scrim, the focus trap, and the stack of overlays inside overlays. Feedback & Notification takes the toast, the other surface that appears without being asked. Keyboard Navigation takes the menu's arrow keys and roving focus. Popovers and tooltips are the smallest overlays in the system, and the most numerous; getting their two rules right (inform or interact, and stay attached to the anchor) is most of what makes an interface feel calm.
Part I of Overlays: Popover & Tooltip.
A tooltip waits to be wanted and leaves without being asked. A popover waits to be asked to leave.