API

API

The browser module exports createFloatingTooltip. The React package adds FloatingTooltip for one trigger and FloatingTooltipGroup for many.

NameDescription
createFloatingTooltip(root, options?)Binds every trigger inside root to one shared popup. Returns refresh, dismiss, update(options) and destroy.
data-reuse-tooltip, data-reuse-tooltip-templateMarks a trigger. The first holds the hint as text, the second names the id of a template to clone.
selectorWhich elements count as triggers. Both attributes above by default.
side, sideOffsetWhere the popup sits from the pointer, such as "bottom-right" or "top", and how far away. Bottom right and 10 px by default.
tiltLeans the popup by up to this many degrees while the pointer moves. 5 by default, 0 turns it off.
delay, closeDelayThe wait before the first hint shows, 150 ms, and before the last one hides, 80 ms. Moving between triggers swaps at once.
content(trigger)Returns text or a node for a trigger, in place of the attributes.
classNameAdded to the popup, for your own styles.
track, viewportPaddingFollow the pointer or stay on the trigger, per axis, and the margin kept from the window edges.
FloatingTooltip, FloatingTooltipGroupThe React components: one trigger with a content string, or a group that takes the same options. tooltipClassName sets the popup's class.