Skip to content

Tooltip

Stable

A short text label that appears on hover and on keyboard focus.

Also known as hint, tip, hover text

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

On an icon button

The tooltip repeats the button name for sighted mouse users. The button keeps its own label.

When to use it

A short extra hint for a control, such as the name of an icon button. It is a bonus for people with a mouse or keyboard. Everything it says must also be available some other way.

Made of: Trigger · Tip

Use it for

  • Naming an icon-only button for people who hover over it.
  • A short reminder of what a control does.
  • Telling people about a shortcut next to the control.

Not for

  • Anything with a link, button or formatting inside: use Popover.
  • Information people must read to finish a task.
  • A shortcut hint shown beside an item: use Kbd.

Do and avoid

Download invoice
Do. A short name for an icon button, nothing people must know.
You are charged 42 euros today. This cannot be refunded.
Avoid. Key facts in a tooltip are missed by touch users and many others.

Do

  • Keep it to a few words.
  • Use it on controls that have little or no visible text.
  • Place it so it does not cover what the person is trying to read.
  • Give the trigger its own name and use the tooltip only as extra.

Avoid

  • Do not put essential information, errors or instructions in it.
  • Do not put links, buttons or other controls inside it.
  • Do not use it on something that cannot take focus.
  • Do not use it to show a longer explanation. Use a Popover or text on the page.

On a phone

  • Hover is ignored on touch screens, so the tip never shows from a touch alone.
  • It still shows when the control gets focus, but do not rely on that: put anything the user must know in visible text.
  • The tip is at most 16rem wide and wraps.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started