Skip to content

Tooltip

The Tooltip component surfaces additional information for an element in a small overlay that appears on hover or focus. It supports a title, a scrollable body, a fixed footer, an arrow, and positioning on any side. Every Tooltip must have a TooltipProvider ancestor — typically wrapped around the entire app.

Variations

Hide arrow

Use hideArrow to remove the tooltip arrow.

Vertical scroll

Content scrolls when it exceeds the max height.

Horizontal scroll

Content scrolls when it exceeds the max width.

Both horizontal and vertical scroll

Content scrolls when it exceeds the max height and max width.

Use the footer prop for content that stays fixed at the bottom when the body scrolls.

Sides

The tooltip can be positioned on any side: top (default), bottom, left, or right.

Alignment

Control tooltip alignment relative to the trigger using align: start, center (default), or end.

Installation

import { Tooltip, TooltipProvider } from "@harnessio/ui/components";
// TooltipProvider typically wraps the entire app.
<TooltipProvider>
<Tooltip title="Title" content={<p>This is a tooltip</p>}>
<Button variant="secondary">Hover me</Button>
</Tooltip>
</TooltipProvider>;