Tooltip

A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.

Loading example…

Installation

bunx --bun shadcn@latest add @sui/tooltip

Install with the shadcn CLI or use the shared @workspace/ui package. Follow the installation guide to configure the registry, load styles, and choose import aliases.

Usage

import {
  Tooltip,
  TooltipContent,
  TooltipTrigger,
} from "@workspace/ui/components/tooltip"
<Tooltip>
  <TooltipTrigger>Hover</TooltipTrigger>
  <TooltipContent>
    <p>Add to library</p>
  </TooltipContent>
</Tooltip>

Composition

Use the following composition to build a Tooltip:

Tooltip
├── TooltipTrigger
└── TooltipContent

Side

Use the side prop to change the position of the tooltip.

Loading example…

With Keyboard Shortcut

Loading example…

Disabled Button

Show a tooltip on a disabled button by wrapping it with a span.

Loading example…

RTL

To enable RTL support in shadcn/ui, see the RTL configuration guide.

Loading example…

API Reference

See the Base UI Tooltip documentation.