Skip to main content
ContainersLevel 1

Tooltip

文字提示

WebDesktopDifficulty: Easy

A small line of text that appears on hover, telling you what an unfamiliar icon actually does.

01

Live Demo

Actually clickable
Hover (or Tab to) any icon and a tooltip appears. An icon button needs one, or users won't know what it does.

What you just saw:Hover an unfamiliar icon and a small dark bar reading "Export as PDF" floats out beside it — that is a tooltip.

02

What it actually is

A tooltip does exactly one thing: it names and explains. It cannot hold buttons (that is a popover) and it cannot carry a critical action. Its biggest limitation is that touch devices can barely trigger it, so it can never be the only place information lives.

tooltiphover hinttitle tiphover labelhint bubble
03

Anatomy · What it's made of

  1. Trigger触发元素

    Usually focusable

  2. Bubble气泡

    Dark background, white text, border-radius 6px

  3. Text文字

    ≤2 lines, never a long sentence

  4. Arrow小箭头

    Points at the trigger element

04

When to Use

When it fits, and when it doesn't
Tooltip usage recommendations
SituationUse it?
An icon button is not self-explanatory and needs a labelYes
A number or an acronym needs a glossYes
Truncated text needs a way to read the whole thingYes
Users need to click a button inside itNo
It holds information required to understand the pageNo

Tooltips are basically untriggerable on mobile, so critical information needs a second, permanent home.

Keep the delay short (around 500ms), or the whole page feels sluggish.

05

Similar Patterns

Don't mix these up
06

How to tell AI

Three levels of prompt

Add the component name and specifics

Add a tooltip to the icon buttons in a toolbar: after a 400ms hover, show the name of the icon; hide it immediately on mouse-out or Esc, and also show it on keyboard focus.

07

Don't just say this to AI

Bad → Better

Don't say this to AI

Show a hint when the mouse goes over it.

Say this instead

Add a tooltip to the icon button: appear after a 400ms hover showing the icon name, hide immediately on mouse-out or Esc, trigger on keyboard focus too, add aria-describedby, flip below automatically near the top of the screen, and keep the text ≤2 lines.

08

Share this card

Social-ready

Turn this pattern into a 3:4 or 1:1 knowledge card and export it as PNG right in the browser. No backend needed.