跳到正文
FunCoding

design-tooltips

Polish: apply in a polish or review pass on existing UI, not while first designing a page; a first build only needs the basics right. When and how to use tooltips, and what a toggle's icon should show. Covers which controls get one, what goes in it (name, shortcut, extra detail), the two delays (labels wait, details show fast), the warm group that opens the next tooltip instantly, touch and accessibility, and whether an icon shows the current state or the action. Use when polishing or reviewing tooltips, icon-only buttons, keyboard shortcuts, a sidebar or panel toggle, or when tooltips feel slow, jumpy or missing.

Star
749
最近提交
2026年11月30日

skills/design-tooltips/SKILL.md

在 GitHub 上查看

Tooltips

When: polish. While first building, only give icon-only buttons an aria-label (and a plain title if there's no tooltip component yet). Delays, warm groups, shortcuts in tooltips and toggle-icon choices belong to a polish pass, on new or existing UI.

Tooltips are what let an interface stay sparse. An icon can stand alone because hovering it once says what it is, and next time you just click. So put them on many things, as Linear does, not just a few. The rest of this skill is about making a lot of tooltips feel calm instead of noisy.

Related: design-menus-and-pickers.

What gets one

  • Every icon-only control. Required, not optional: the tooltip is its visible name.
  • Anything with a keyboard shortcut, even when it has a text label. Showing the shortcut where people already look is how they learn it.
  • Compact data that needs explaining: a "+12 −3" diff, a streak flame with a number, a status dot, a relative time ("3h", the full date in the tooltip), a truncated name.
  • Not text that already says the same thing, or controls whose label is fully visible and have no shortcut. A tooltip repeating the button text is noise.

What goes in it

  • The action, not the icon: "Hide sidebar", not "Sidebar". "Copy link", not "Link".
  • The shortcut after the label, set apart as keys: Hide sidebar [ or Search ⌘K. Use the platform's symbols (⌘ ⌥ ⇧ on Mac).
  • For data, the detail: "12 lines added, 3 removed", "Current streak: 41 days", "Nov 28, 2026, 14:03".
  • One short line. No sentences ending in a period, no interactive content (no links or buttons: they can't be reached). If it needs a paragraph or a link, it's a popover.

Timing: two kinds of tooltip

Not every tooltip should wait the same. Decide per tooltip which kind it is.

KindExamplesDelay before showing
Label: names a control people use all the timemain navigation, toolbar icons, sidebar toggle~500–700ms
Detail: adds information someone hovered to getdiff counts, streak numbers, timestamps, truncated text, avatars in a stack~0–150ms

Why: a label tooltip appearing every time your cursor rests on a nav icon you already know is clutter, and the cursor rests there right after every click. A detail tooltip is the reason for hovering, so making people wait for it is annoying.

The warm group

Once a tooltip has shown, the next one should show instantly, with no delay and no animation, as long as the cursor moves to it within ~300–500ms of the last one closing. Someone moving along the sidebar after the first tooltip is exploring what each item does. Hiding and then waiting again before each one feels broken.

  • The simple, generic rule (what Radix's skipDelayDuration and Base UI's data-instant do): one shared timestamp of "a tooltip was visible until T". If now − T is under the skip window, open immediately. That works across groups too and is usually enough.
  • Only the first tooltip in a run animates (fade + scale(0.97), ~125ms ease-out, from the trigger). Instant ones just appear and swap.
  • Hide on mouse leave right away (no exit delay), on click of the trigger, on scroll, and on Escape.
  • Clicking a control hides its tooltip and keeps it hidden until the cursor leaves and comes back, so it doesn't reappear over the result of the click.

Touch and accessibility

  • Touch has no hover. Never put information only in a tooltip that touch users need. For icon-only buttons the name also goes in aria-label; for details, show them somewhere tappable (the detail page, a popover on tap).
  • Show on keyboard focus too (:focus-visible), with the same delays.
  • The tooltip text is the accessible name or description: aria-label on icon-only buttons, or aria-describedby pointing at the tooltip for extra detail. Hide purely visual duplicates with aria-hidden.
  • Don't cover what the user is pointing at or the next thing they'll click: prefer the side away from the content flow (right of a left sidebar, above a bottom toolbar), with a small 6–8px gap.

Icons for toggles: state or intent?

A toggle's icon can show the current state or what happens on click. Pick per control, and let the tooltip always say the action.

  • Show the state when the control mirrors something visible on screen: a sidebar or panel toggle, a layout or density switch, a view mode. The icon is a tiny picture of the current layout. Linear's sidebar toggle draws a narrow sidebar when it's collapsed and a wide one when it's open, and animates between them. The tooltip says "Show sidebar" / "Hide sidebar".
  • Show the intent when the state is obvious elsewhere and the button is a verb: play/pause (show ▶ when paused), mute (shows the speaker you'll get), expand/collapse a section (chevron points where it will go).
  • For on/off settings where neither reads well, keep one icon and show the state with fill or color (outlined = off, filled = on, like the current page in a nav), not by swapping to a different picture.
  • When the icon changes, animate the change (~150–200ms, morph or crossfade) so people see that their click did it, unless reduced motion is on.

Checklist

  • Every icon-only control has a tooltip and an aria-label
  • Shortcuts appear in the tooltip of their control
  • Each tooltip is labelled as label (slow) or detail (fast)
  • A shown tooltip makes the next one instant (shared skip window)
  • Hidden on click, scroll, Escape and mouse leave; shown on keyboard focus
  • Nothing important lives only in a tooltip on touch devices
  • Toggle icons follow state-vs-intent above; the tooltip says the action

相似的 Skill

reverse-engineer-anything

MOmorluto/rea486k近 7 天新增 8,943 个 star

reverse-engineer-anything

MOmorluto/rea486k近 7 天新增 8,943 个 star

test-driven-development

OBobra/superpowers331k近 7 天新增 4,772 个 star

精选

accessibility

审计 Web、iOS、Android 的无障碍合规,支持键盘导航与屏幕阅读器。

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star

ai-regression-testing

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star

agent-runtime-gateway-smoke-test

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star