Skip to main content

Tooltip

A short text hint that appears when the user hovers over or focuses a trigger, built on Base UI's Tooltip primitive. Hover over or tab to each button below.

import { Button, Tooltip } from '@jbpark/ui-kit';

<Tooltip content="Copy to clipboard">
<Button>Copy</Button>
</Tooltip>;

Props​

PropTypeDefaultDescription
childrenReactElementrequiredThe trigger. A single element that can receive focus and pointer events.
contentReactNoderequiredTooltip text.
placementplacement name (see below)'top'Side and alignment relative to the trigger.
offsetnumber8Distance between the trigger and the popup in pixels.
delaynumber600Hover delay before opening, in milliseconds. Keyboard focus opens at once.
closeDelaynumber0Delay before closing, in milliseconds.
openboolean-Controlled open state.
defaultOpenbooleanfalseInitial open state when uncontrolled.
onOpenChange(open: boolean, details) => void-Called when the open state changes.
disabledbooleanfalsePrevents the tooltip from opening.
classNamestring-Popup class. The trigger keeps its own className.

placement: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom'.

A tooltip is a supplementary hint. It does not appear on touch devices without a hover, so keep essential information visible elsewhere. For interactive content (links, buttons) or a title, use Popover instead.

Tooltip also accepts the other props of Base UI's Tooltip.Root (for example trackCursorAxis and onOpenChangeComplete). The popup renders into the container from Config's getContainer.