Clinia UI

Tooltip

A short label that appears on hover or focus, mostly for icon-only controls.

shadcn docs →

When to use

  • Name an icon-only button: Copy API key on a copy icon.
  • Show the keyboard shortcut for a control.

When not to use

  • Information users need to finish the task: put it on the page, or in a Field description.
  • Links, buttons, or several lines of content: use Popover.
  • A preview of a linked person or record: use Hover Card.

Install

npx shadcn@latest add @clinia/tooltip

Clinia rules

  • The tooltip is text-xs on an inverted bg-foreground surface, so its text keeps full contrast in both themes.
  • TooltipProvider sets delay to 0: the tooltip opens as soon as the pointer rests. Mount the provider once, at the app root.
  • Copy is a short phrase in sentence case with no final period. It matches the control's accessible name.
  • A Kbd inside the tooltip shows a shortcut. The tooltip adjusts its padding to fit it.

Do and don't

Do give an icon-only button a tooltip that matches its accessible name.
Don't hide a warning in a tooltip. Say it on the page.

Accessibility

Built in

  • Opens on hover and on keyboard focus. Escape closes it.

Your responsibility

  • Give the trigger an aria-label that matches the tooltip text. The tooltip is a visual label only, and screen readers don't rely on it.
  • Touch screens can't hover. Never make a tooltip the only place a name, a warning, or an instruction appears.

How to test

  1. Press Tab to the trigger: the tooltip opens.
  2. Press Escape: it closes, and focus stays on the trigger.
  3. With a screen reader, the trigger is announced by its aria-label, the same words as the tooltip.
  4. On a phone, check that the control still makes sense with no tooltip at all.

API

Every prop comes from Base UI Tooltip.