Dustin Johnson ← Design Primitives
Design Primitive Reference · Part I · October 2026

Overlays: Popover & Tooltip

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.

I. Tooltip vs Popover

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.

Peak fareiPeak fares apply 07:00–09:30 on weekdays. See the fare table£14.20
Tab moves past it · touch never sees it
A link inside a tooltip · Wrong

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.

Timetables ▾Winter 2026Summer 2027ArchivedVesselsCrews
pointer crosses the gap · menu closes
A menu that opens on hover · Wrong

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.

Select two sailings to merge
disabled · no hover events · not focusable
A tooltip on a disabled button · Wrong

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.

ExportExport
adds nothing · covers the row above
A tooltip that repeats the label · Wrong

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.

TooltipPopover
JobNames or explains its anchorHolds controls or content the user works with
Opens onHover after a delay; keyboard focus at onceClick, Enter, or Space on the anchor
ContentText: a label, a shortcut, up to a title and two linesMenus, forms, details, pickers; anything focusable
Closes onPointer leaving anchor and tooltip; blur; EscapeClick outside, Escape, the anchor again, or completing the task
FocusNever moves; stays on the anchorMoves in if there is something to focus; returns to the anchor on close
Semanticsrole="tooltip" · aria-describedbypopover · aria-expanded · aria-controls
TouchNone; it doesn't exist on touchSame as click
Layerlevel 2 · z-tooltip 1400level 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 says something about its anchor; a popover lets you do something next to it. Anything you can click is popover content, and popovers open on click.

II. Anatomy

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.

Duplicate sailing⌘D Surface · #1a1a1a · radius 4 Text · 12/16 · 400 · #fafaf8 Anchor · icon button 28 Shortcut · mono 11 · 12 gap Height 28 · 6 + 16 + 6 Offset 4 Level 2 shadow · no arrow
Filter Filter sailingsShow sailings that match all of these. RouteAll routes▾VesselAny vessel▾ ClearApply Anchor · text button Offset 8 · edges aligned Title · 13/20 · 600 Body · 13/20 · muted Field · 32 · from Inputs Radius 8 · md Hairline · 1px · .10 Surface · #fff · opaque Shadow · level 2 Inset 16 · all sides Footer · end-aligned Width 280 · form class
Tooltip 28px tall · offset 4 · shortcut gap 12 · Popover 280 wide · offset 8 · start edge on the anchor's start edge, 0px apart Tooltip and popover at 1:1 · Measured in the browser

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.

Width and the 240px Tooltip

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.

Late sailings run on the winter timetable and skip the Hollin Quay stop.240 Late sailings run on the winter timetable and skip the Hollin Quay stop.
Top · max-width 240 · 224px of text · two lines, 42 and 30 characters · Right
Bottom · no cap · one line of 72 characters, 406px wide · Wrong
The same sentence, capped and uncapped

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.

The tooltip is the smallest surface in the system: dark, 28px, 240px at most. The popover is a small container: white, hairline and shadow, 16px in, actions at the end.

III. The Anchor & the Gap

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.

Open sailingDuplicateCopy link 8 · centred · 0 centres 56 apart Icon button · centred
Sort Departure✓RouteVessel 8 · start · 0 starts 37 apart Text button · start
VesselMV Tern▾ MV Tern✓MV SkuaMV Fulmar 8 · both edges · 0 gap 0 · 42 narrower Field · start + width
Offset 8 under each anchor · icon centre to menu centre 0 · button start to menu start 0 · field and listbox, both edges 0 Icon menu end-aligned: centres 56px apart · Button menu centred: start edges 37px apart · Listbox fused at 0, 42px narrower than its field Each anchor's own alignment · Right Alignments swapped, gap removed · Wrong

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.

Four pixels for a tooltip, eight for a popover, and the popover continues the anchor's edge, or its centre when the anchor is an icon.

IV. Placement & Collision

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.

Viewport · 600 × 300 · 8px padding Pin to boardPin to board Route All routes✓Ostrand – Hollin QuayOstrand – CarrowCarrow – Fenmouth All routes✓Ostrand – Hollin QuayOstrand – CarrowCarrow – Fenmouth Sort Departure timeRouteVesselLast edited Departure timeRouteVesselLast edited More actionsMore actions 1 · flip: top → bottom 2 · flip alignment: start → end · ends 0 apart 3 · flip: bottom → top 4 · shift 28px · inside the padding 1 · cut off at the top 2 · runs off the right edge 3 · clamped: covers its anchor 4 · cut off at the right
1 tooltip flipped below, 4px under the pin · 2 menu end-aligned, its end edge on the button's · 3 menu flipped above, 8px over the button · 4 tooltip shifted 28px left, 8px from the edge, still 4px above 1 tooltip 20px above the viewport, 8px of it showing · 2 menu 112px past the right edge · 3 menu clamped up over its own button · 4 tooltip 20px past the right edge Four anchors near the edges, each resolved · Right The same anchors at their default placements · Wrong

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.

// Floating UI: the order is the middleware order. computePosition(anchor, popover, { placement: 'bottom-start', // tooltips: 'top' strategy: 'fixed', middleware: [ offset(8), // tooltips: 4 flip({ padding: 8, fallbackPlacements: ['bottom-end', 'top-start', 'top-end'] }), shift({ padding: 8 }), // only once every flip has failed size({ padding: 8, apply({ availableHeight, elements }) { elements.floating.style.maxHeight = `${availableHeight}px`; // scroll inside; never cover the anchor } }), ], }); /* The platform: anchor positioning, no script. */ .filter-trigger { anchor-name: --filter; } .filter-popover { position: fixed; position-anchor: --filter; position-area: bottom span-right; /* below, starting on the anchor's start edge */ margin-block-start: 8px; position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline; position-visibility: anchors-visible; /* hide when the anchor scrolls away */ }

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.

Flip the alignment, then the side, then shift as little as possible. The surface stays on screen and off its anchor, whatever it takes.

V. Tooltip Delay & Dismissal

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.

Pointerenters Duplicatemoves to Pinleaves the toolbar
Duplicate tooltipdelay 400
Pin tooltip0
Warm state+300
Keyboard focus0
040070011001400 ms
First tooltip after 400 · the next in the group at 0 while warm · warm ends 300 after the last closes · focus shows at 0 · each hides in snap 60 One trip across a toolbar, timed

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.

Delay 0 · every pass firesNo delay · Wrong
400 on every buttonDelay, never warm · Avoid
400 first · 0 warm · 300 graceDelay, then warm · Right
Measured in Chrome · first tooltip visible at 413ms · the next one while warm at 15ms, one frame · back within 250ms of leaving: still warm; after 400ms: cold · hidden 61ms after the pointer leaves · on Tab: 16ms Sweep the pointer straight across each toolbar, then rest on a button and slide to its neighbours. The first toolbar lights every button it crosses; the second makes you wait at each one; the third ignores the sweep and, once you've stopped, answers instantly along the row. Tab into any of them and the tooltip is there at once.

Dismissal

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.

Four hundred milliseconds to the first one, nothing to the next, at once for the keyboard, gone on Escape, never on touch.

VI. Popover Dismissal & Focus

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.

Sat 13 Feb Filter sailingsDeparturesArrivalsCancelledClear
Ostrand – Hollin Quay07:40
Carrow – Fenmouth08:15
Ostrand – Carrow09:05
Hollin Quay – Ostrand09:50
Fenmouth – Carrow10:30
Ostrand – Hollin Quay11:10
Click anywhere outside · the anchor again · Apply Light dismiss · Right
Sat 13 Feb Filter sailingsDeparturesArrivalsCancelled
Ostrand – Hollin Quay07:40
Carrow – Fenmouth08:15
Ostrand – Carrow09:05
Hollin Quay – Ostrand09:50
Fenmouth – Carrow10:30
Ostrand – Hollin Quay11:10
Only the ✕ · a 24px target in the corner Close button only · Wrong
Both start open. Click a row of the timetable: the first popover gets out of the way, as a surface that doesn't block the page should. The second ignores the click, ignores its own Filter button, and waits for the ✕.

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).

1 · TabFocus lands on FilterThe anchor; nothing open.
2 · EnterOpens; focus to DeparturesThe first control inside. A popover with nothing to focus leaves focus on the anchor.
3 · EscapeCloses; focus back on FilterSo the next Tab continues from where the user was.
4 · Click outsideCloses; focus goes where they clickedNever yanked back to the anchor.
Focus through one popover · The anchor is home

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.

<button popovertarget="filter">Filter</button> <div id="filter" popover> <!-- auto: light dismiss, Escape, top layer, one at a time --> <h2>Filter sailings</h2> … <button popovertarget="filter" popovertargetaction="hide">Apply</button> </div> /* No scrim: the page keeps responding. ::backdrop stays transparent. */ [popover]::backdrop { background: none; }
A popover is not modal, so it gets out of the way: on a click outside, on Escape, on its own anchor, and it never takes the user's work with it.

VII. Motion

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.

Pin to board ShowDeparturesArrivalsBoth
Tooltip: opacity, fast 150 in, snap 60 out · Popover: opacity + 4px from the anchor, fast in, snap out in place Fade, and a short drop from the anchor · Right
Pin to board ShowDeparturesArrivalsBoth
transition: all 300ms ease, both ways · tooltip rises 10px · popover scales from .8 at its own centre Slides and zooms · Wrong
Open and close a few times, then try slow motion. The right pair are there as soon as you look and gone when you're done. The wrong tooltip drifts up toward the pointer; the wrong menu swells out of thin air between the button and the page, belonging to neither.

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.

SurfaceDelayEnterExitMovement
Tooltip400 · 0 warmfast · ease-entersnap · ease-exitOpacity only
Popover, menu0fast · ease-entersnap · ease-exitOpacity + 4px from the anchor's side; out in place
Hover card500fast · ease-entersnap · ease-exitAs a popover
Reduced motionunchangedunchangedunchangedDistance 0; opacity only
The tooltip fades because the pointer is resting; the popover drops 4px because it came out of something. Neither grows, neither lingers.

VIII. Rich Tooltips & the Line

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.

Duplicate sailing⌘Dgap 12 · mono 11
Label 12/16 · shortcut 11px mono, trailing, #a8a8a4 at 7.3:1 · 12px betweenLabel + shortcut · Right
Crew hoursHours worked this week on all sailings, including standby at the pier.
Title 12/16 · 600 · two lines of 12/16 · 240 wide, 60 tallTitle + two lines · The limit · Right
Ostrand – Hollin QuayEdit route
An image and a button, on hover · unreachable by keyboard and touchA popover opened by hover · Wrong
Peak fare iPeak faresWeekdays 07:00–09:30, on every route. Season tickets are exempt.Read the fare policy
Click the "i" · focus moves in · the link is reachableHelp popover on an "i" · Right

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."

A label, a shortcut, a title and two lines: that is everything a tooltip holds. The first link makes it a popover.

IX. The Popover's Content Classes

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.

Open sailing↵Duplicate⌘DMove to timetable…Copy link
32px rows · 4px inset · text 12px inside the hairline · routine actions onlyMenu · Right
FilterFilter sailingsRouteAll routes▾VesselMV Tern▾ClearApply
280 wide · 16 inset · Apply is the primary, and reversibleForm · Right
R. AlmeidaRARui AlmeidaHarbour dispatcher · OstrandOn shiftuntil 18:00Sailings today6DeskPier 2 edited this sailing
300 wide · nothing to operate · opened on click; as a hover card, 500msDetail · Right
Sailing dateSat 13 Feb 2027▾February 2027‹ ›MoTuWeThFrSaSu12345678910111213141516171819202122232425262728
Width from the grid: 7 × 32 + 6 × 4 + 2 × 16 = 280, plus the hairline · start-aligned to the fieldPicker · Right
RescheduleReschedule 14 sailingsNew departure09:401,240 booked passengers are notified as soon as you save.Save
Irreversible, behind a surface a stray click closes · no confirmationA commit in a popover · Wrong
R. AlmeidaRARui AlmeidaHarbour dispatcher · OstrandOn shiftuntil 18:00MessageAssign sailing edited this sailing
Opens on hover · two buttons a keyboard can't reachA hover card with controls · Wrong

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.

ClassWidthInsetFocus on openCloses when
Menu≥ anchor, by content4 · rows 32First itemAn item is chosen; outside; Escape
Form28016First fieldApply; outside (choices kept); Escape
Detail300–32016Stays on the anchorOutside; Escape; anchor again
PickerFrom its grid16The selected valueA value is chosen; outside; Escape
Menu, form, detail, picker. Each is reversible and each is small; the first irreversible button turns it into a dialog.

X. Stacking

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.

Ostrand – Hollin Quay07:40
Carrow – Fenmouth08:15
Ostrand – Carrow09:05
Hollin Quay – Ostrand09:50
Fenmouth – Carrow10:30
Ostrand – Hollin Quay11:10
Carrow – Fenmouth11:45
Edit sailing 07:40VesselMV Tern▾Departure07:40CancelSave changes
MV Tern✓MV SkuaMV FulmarMV Gannet
Listbox 1000 · scrim 1190 · dialog 1200 · drawn under both Top layer · opened after the dialog, so painted after it Popover from a modal, on the page's layer · Wrong Popover from a modal, in the top layer · Right
FilterFilter sailingsDeparturesInclude cancellediCancelled sailings stay listed for 30 days, struck through.ClearApply
Tooltip 1400 over popover 1000 · centred on its icon, 4px up Tooltip over its own popover · Right
Switch the listbox to the page's popover layer: it opens beneath the scrim and behind the dialog, dimmed and half hidden, while the field above it reads as open.

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.

A popover opened from a modal belongs to the modal. Put it in the top layer and let opening order decide; the z-index scale is for the page.

XI. Dark Mode

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.

Duplicate sailing⌘D FilterFilter sailingsShow sailings that match.RouteAll routes▾ClearApply
Ostrand – Hollin Quay07:40
Carrow – Fenmouth08:15
Ostrand – Carrow09:05
Light · tooltip #fafaf8 on #1a1a1a 16.7:1, shortcut #a8a8a4 7.3:1 · popover #1a1a1a on #fff 17.4:1 Dark · tooltip #ecebe8 on #363636 10.1:1, shortcut #b0b0ae 5.6:1, surface vs canvas 1.55:1 + hairline · popover #ecebe8 on #282828 12.4:1, muted 6.8:1 Inverted · #1a1a1a on #ecebe8 14.6:1, but the chip against the #121212 canvas is 15.7:1, the brightest thing on screen Light · The reference · Right Dark · Tooltip one step up the ramp, popover on level 2 · Right Dark · Tooltip inverted to a light chip · Reads as an alert · Wrong

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.

Dark mode keeps the tooltip dark and quiet, one step up the ramp; the popover climbs to level 2 and draws its edge with light.

XII. The Checklist

Decide each overlay in this order, once per component; each step assumes the ones before it.

1
Anything to operate in it?No: tooltip, if it adds what the anchor can't show. Yes: popover, opened on click. A disabled control explains itself in visible text.
2
Build it from the tokensTooltip: 12/16 · 400, inset 6/8, radius 4, #1a1a1a, 240 max, 28 tall. Popover: #fff, hairline .10, level 2, radius 8, inset 16, title 13/600.
3
Hang it from the anchorTooltip 4px, popover 8px from the visible edge. Start-aligned from text buttons and fields, centred on icons; a listbox matches its field's width.
4
Resolve collisions in orderTooltips above, popovers below. Flip alignment, flip side, shift the minimum, shorten and scroll. 8px from the viewport; never over the anchor.
5
Time the tooltip400ms, then 0 while warm with a 300ms grace; at once on focus. Hoverable, dismissible with Escape, persistent until left. None on touch.
6
Make the popover dismissibleOutside click, Escape, the anchor again, task done. No scrim, no trap. A close button only as an extra. Light dismiss never loses work.
7
Route focusInto the popover's first control if it has one, else stay on the anchor. Back to the anchor on Escape. aria-expanded on the anchor; aria-describedby for tooltips.
8
Move it honestlyTooltip: opacity, fast in, snap out. Popover: opacity + 4px from the anchor's side, fast in, snap out in place. Distance 0 under reduced motion.
9
Keep tooltips smallLabel, shortcut, or a title and two lines. An image, link, or button makes it a popover; help with links goes behind an "i".
10
Classify the popoverMenu, form, detail, or picker, each with its width and focus. Nothing irreversible; a hover card waits 500ms and holds no controls.
11
Open it in the top layerThe popover attribute or a portal to the root. From a modal, the top layer or the modal's own context; never a raised --z-popover.
12
Check both modesOpaque everywhere. Dark tooltip #363636 with a hairline, never inverted; dark popover #282828. Every ink measured against the surface it's on.

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.