Skip to content
HomeCobalt

Tooltip

Names a control that has no visible name, on hover and on keyboard focus, after one shared delay.

Examples

Two icon buttons that share one provider and its delay.
€1,240.00
In an icon buttonIconButton uses one string for its name and its tooltip, beside a CopyButton under the same provider.
Q3 holdings report

Usage

Use it when

  • A control is only an icon, and a pointer user needs its name without pressing it.
  • A row of icon-only controls, such as a toolbar or the segmented control's icon options, needs names that appear as the hand moves along.
  • An icon-only control also answers a key. Pass the keys to IconButton's shortcut, which writes them after the name; nothing else goes after it.

Use something else when

  • The text is more than the control's name, such as a reason or a description. Use Popover instead, or visible text beside the control.
  • The content holds a link or a button. Use Popover instead.
  • The control is disabled and the text says why. Use visible text beside it instead, or keep the control focusable with aria-disabled and the reason in a Popover.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/tooltip.json
import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "@/components/cobalt/ui/tooltip"