Overview
Three tooltip studies showing different production registers: a frosted-glass command-palette tip with a gradient halo and embedded keycap (spring scale-in), a rich profile-preview card that unfurls on @-mention hover with avatar + stats (rotate-in landing), and an editorial marginalia footnote that draws a dotted connector down to a tilted parchment aside.
When to use it
Reach for tooltips for keyboard-shortcut hints, glossary terms, and inline disclosures of secondary info. Skip them for critical content (use inline text instead) and for any interaction that needs user action inside the tooltip itself — tooltips close on focus loss, which traps modal actions.
How it works
Each tooltip sits absolutely positioned next to its trigger inside a relatively-positioned wrapper. CSS :hover + :focus-within on the wrapper toggle opacity + transform on the tooltip. The frosted study layers a backdrop-filter: blur(12px) + a soft gradient halo behind the tip; the profile card uses perspective(800px) rotateX(8deg) + a slight translateY for the unfurl-in landing; the editorial study draws an SVG dashed connector via stroke-dashoffset animation paired with the body fade-in. For positioning collisions with viewport edges, drive the placement with a JS measure-and-shift pass on mouseenter — pure CSS cannot detect edge overflow.
Production gotchas
Tooltips that close on focus loss are the right pattern for transient hints but the wrong pattern for any tooltip that contains interactive content (links inside the tip). Use aria-haspopup + a popover instead when users need to click inside. Tooltips clipped by overflow: hidden on an ancestor look broken — either move the tooltip to a portal at the body root or use the new popover="auto" attribute which renders in the top layer above all overflow constraints.
Accessibility
Tooltips need role="tooltip" + aria-describedby on the trigger pointing to the tooltip ID so screen-reader users hear the helper text after the control name. Hover-only tooltips are inaccessible to keyboard users; always include :focus-within as a trigger. Under prefers-reduced-motion: reduce drop the unfurl/spring transforms and use a flat opacity fade.
References
Implementation depth
Tooltips are support text, not required content. Use focus and hover to reveal them, keep the trigger label meaningful on its own, and avoid making the animation the only way to discover important information.
Positioning is the fragile part. Long strings, viewport edges, and touch input can all break a pretty tooltip. Test focus-within, Escape behavior where applicable, and reduced motion with the tooltip already visible.