Skip to content

Tooltip

A short hint on hover or focus, on any side. Rendered above everything, including dialogs.

On this page
Used for
  • Icon button label
  • Shortcut hint
  • Truncated name
  • Disabled reason

Examples

Installation

npx knowns-ui@latest add tooltip popover
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

content
ReactNode
Tooltip text. Read as the trigger's description (aria-describedby on the child).
description
ReactNode
Second, muted line.
side / align
"top" | "bottom" | "left" | "right" / "start" | "center" | "end"
Default"top" / "center"
Preferred placement. Flips to the opposite side when there is no room and stays 8px inside the viewport.
delay / closeDelay
number
Default300 / 80
Hover delays in ms. Keyboard focus shows it at once; Escape hides it.
TooltipGroup
delay?: number, closeDelay?: number
Default- / 140
Wrap a row of triggers. They share one tooltip: the first opens after its delay, moving to the next glides the same tooltip over and morphs its size to the new text, with no delay. Jumps instead of gliding under reduced motion.
disabled
boolean
Defaultfalse
Never show. It also hides itself while the trigger's popup is open (aria-expanded).
Popover side / align
"top" | "bottom" / "start" | "center" | "end"
Default"bottom" / "start"
Same floating engine. Focus moves into the panel; Tab continues after the trigger.

What it handles

  1. 01Wraps one child, usually a button or link, and shows content on hover after delay (about a third of a second) or on keyboard focus at once.
  2. 02Adds an optional muted description line under the hint, and describes the child itself through aria-describedby while it shows.
  3. 03Opens in a portal with side and align, flips when there is no room, and keeps pointer events off the bubble.
  4. 04Hides on Escape, on pointer down and on blur, and hides itself while the trigger has aria-expanded true, so it never covers an open menu.
  5. 05Warms up: a second tooltip opened within a moment of the last close appears with no fade, which suits a sweep along a toolbar.
  6. 06Skips touch pointers, and disabled keeps the trigger working while never showing the hint.

States

First render
Nothing. The bubble is not mounted until it opens
none
Hover or focus
The bubble fades in after the delay
120ms, opacity only
Next tooltip in a sweep
It appears with no fade at all
none
Pointer leaves
After a short close delay the bubble fades out a little quicker
120ms, opacity only
Reduced motion
It appears and unmounts at once
0ms

Works with

When to use

When to use

  • A short hint for an icon button or a truncated label, on hover and focus.

When not to use

  • Content with links or controls: use Popover.
  • Information the user needs on touch screens: there is no hover there.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Tooltip to my app and wire it to my own data.
  • I need a short hint for an icon button or a truncated label, on hover and focus. Set that up with the Knowns UI Tooltip.
  • Which Tooltip props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "tooltip" }) and search_docs({ query: "tooltip" }).

Need help?

Stuck on Tooltip, or found something off? We read every message.