Skip to content
Harness Design System Harness Design System Harness Design System

Tooltip

beta

The Tooltip component provides additional information for an element in a small overlay.

Usage

import { Tooltip, TooltipProvider } from '@harnessio/ui/components'
// ...
return (
<TooltipProvider> {/* typically wrapped around the entire app */}
{/* ... */}
<Tooltip
title="Title"
content={<p>This is a tooltip</p>}
>
<span>Hover me</span>
</Tooltip>
</TooltipProvider>
)

Tooltip with no arrow

Sides

The Tooltip component can be displayed to any side of the trigger element. If there isn’t any room to display the tooltip on the preferred side, the tooltip will instead be displayed on the opposite side. Using the side prop, the Tooltip component supports top, bottom, left and right sides.

Alignment

The Tooltip component can be aligned relative to the anchor or trigger element using the align prop. It supports start, center, and end values. This controls how the tooltip is positioned along the side it appears on.

API Reference

TooltipProvider

The provider component that manages tooltips. Typically wrapped around the entire app.

PropRequiredDefaultType
childrentrueReactNode

Tooltip

PropRequiredDefaultType
contenttrueReactNode
titlefalseundefinedstring
sidefalsetop'right' | 'left' | 'top' | 'bottom'
alignfalsecenter'start' | 'center' | 'end'
hideArrowfalsefalseboolean
delayfalse500number
childrentrueReactNode