Skip to content

Tooltip

A tooltip on Base UI Tooltip.

A short label for a control that a pointer or the keyboard can reach. On a touch screen it never shows, neither on a tap nor on a long press, so it may only repeat what the control already says.

Default

With a shortcut

Sides

With a delay

Installation

npx shadcn@latest add @khaeli/tooltip

Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.

Installs with

Registry items
npm packages
  • @base-ui/react ^1.7.0

Keyboard

Tab
Focusing the trigger with the keyboard shows the tooltip at once, even when TooltipProvider sets a delay. Moving focus on hides it.
Escape
Hides the tooltip. Focus stays on the trigger.

Accessible name

  • The tooltip is not tied to its trigger: it has no role="tooltip" and the trigger gets no aria-describedby. An icon-only trigger needs its own aria-label, and the tooltip repeats it for people who see the screen.
  • A shortcut goes in a @khaeli/kbd inside TooltipContent. The tooltip shows the keys and binds nothing.
  • TooltipProvider sets the wait before a pointer opens a tooltip: none by default. With a delay, once one tooltip is open its neighbours open without waiting.

Registry JSON

The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/tooltip.json