Skip to content

Overlays

Tooltip

Bundle size
17.1 KB
3.0.0

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

This component is our take on the Tooltip developed and maintained by Radix UI.

KeyDescription
Tab

Opens/closes the tooltip without delay.

Space

If open, closes the tooltip without delay.

Enter

If open, closes the tooltip without delay.

Escape

If open, closes the tooltip without delay.

Terminal window
pnpm add @inpulse-ui/tooltip

Wraps your app to provide global functionality to your tooltips.

PropTypeDefault ValueRequired
delayDurationnumber700No
skipDelayDurationnumber300No
disableHoverableContentboolean-No

Contains all the parts of a tooltip.

PropTypeDefault ValueRequired
defaultOpenboolean-No
openboolean-No
onOpenChangefunction-No
delayDurationnumber700No
disableHoverableContentboolean-No

The button that toggles the tooltip. By default, the Tooltip.Content will position itself against the trigger.

PropTypeDefault ValueRequired
asChildbooleanfalseNo
Data AttributeValue
[data-state]

When used, portals the content part into the body.

PropTypeDefault ValueRequired
forceMountboolean-No
containerHTMLElementdocument.bodyNo

The component that pops out when the tooltip is open.

PropTypeDefault ValueRequired
asChildbooleanfalseNo
aria-labelstring-No
onEscapeKeyDownfunction-No
onPointerDownOutsidefunction-No
forceMountboolean-No
side

enum

No
sideOffsetnumber0No
align

enum

No
alignOffsetnumber0No
avoidCollisionsbooleantrueNo
collisionBoundaryElement | Element[][]No
collisionPaddingnumber | Partial<Record<Side, number>>0No
arrowPaddingnumber0No
sticky

enum

No
hideWhenDetachedbooleanfalseNo
Data AttributeValue
[data-state]
[data-side]
[data-align]

An optional arrow element to render alongside the tooltip. This can be used to help visually link the trigger with the Tooltip.Content. Must be rendered inside Tooltip.Content.

PropTypeDefault ValueRequired
asChildbooleanfalseNo
widthnumber10No
heightnumber5No

Wrap your tooltip components with TooltipProvider to provide the necessary context for the tooltip functionality. The Tooltip component contains the trigger and content, while TooltipTrigger is the element that activates the tooltip, and TooltipContent is the floating element that displays the information.

<TooltipProvider>
<Tooltip>
<TooltipTrigger>
Say something
</TooltipTrigger>
<TooltipContent>
<p>Hello, World!</p>
<TooltipArrow />
</TooltipContent>
</Tooltip>
</TooltipProvider>

By default, the Tooltip adopts the primary color as the background.

Adopt a monochromatic style for the Tooltip by setting the mono property to true. This style will adapt to the system’s light and dark mode. The property must be applied directly to TooltipContent.

You can ask the Tooltip to appear from four different positions, using the position property that must be applied to the TooltipContent subcomponent. Possible values ​​are: top, right, bottom and left.

You can set the Tooltip to be displayed by default, without requiring user interaction. To do this, simply add the defaultOpen property in the Tooltip subcomponent.

Hello, World!

Hello, World!

You can remove the Tooltip display delay by setting the delayDuration property to 0 in the TooltipContent subcomponent. This property can also be applied to TooltipProvider. When applied to TooltipProvider, all Tooltips within it will have the delay removed. If both have the property, the value of TooltipContent will prevail.

Use the onChange event to perform an action every time the opening value of the Tooltip is changed.

Project

Built with by Jo Santana in Brazil.

© 2026 Inpulse. All rights reserved.