Import
Description
A tooltip component that displays helpful text when hovering over or focusing on an element. Supports advanced positioning with collision detection and cursor tracking.High-Level API
content parameter specifies what to display in the tooltip.
Props
Component that triggers the tooltip (first positional argument)
Content to display in the tooltip
Whether tooltip is currently open (controlled)
Initial open state (uncontrolled)
Disable the tooltip
Which axis the tooltip should track the cursor on
When true, popup closes when pointer leaves trigger even if it moves to popup
Timing Props
Delay in ms before tooltip opens on hover
Delay in ms before closing tooltip after hover ends
Positioning Props
Which side of trigger to position against
How to align relative to the side
Distance between trigger and tooltip in pixels
Offset along alignment axis in pixels
Minimum distance between arrow and tooltip edges
Element selector to position against (defaults to trigger)
Boundary element for collision detection
Padding from collision boundary
Maintain position after anchor scrolls out of view
CSS position property to use
Disable tracking anchor’s layout shifts
Strategy for handling collisions
Portal Props
Parent element selector for portal
Keep portal mounted when hidden
Event Handlers
Called when tooltip opens or closes
Called after animations complete
Compositional API
tooltip.provider()
Provider for managing multiple tooltips.Default open delay in ms for all tooltips
Default close delay in ms
Time window in ms where another tooltip opens instantly after closing previous one
tooltip.root()
Root container for a tooltip.Controlled open state
Initial open state
Cursor tracking axis
Disable tooltip
Disable hoverable popup behavior
tooltip.trigger()
Element that triggers the tooltip.Open delay in ms
Close delay in ms
Custom trigger component
tooltip.portal()
Portals tooltip to different DOM location.Parent element selector
Keep mounted when hidden
tooltip.positioner()
Positions tooltip relative to trigger.Alignment
Alignment offset
Side to align to
Distance from trigger
Arrow padding
Anchor element
Collision boundary
Boundary padding
Sticky positioning
Position method
Disable anchor tracking
Collision strategy
Custom positioner
tooltip.popup()
Container for tooltip content.Custom popup component
tooltip.arrow()
Arrow pointing to trigger.Class Names
Access default class names viatooltip.class_names:
TRIGGER: Trigger element stylingPOPUP: Popup container stylingARROW: Arrow element styling