API
API
The browser module exports createFloatingTooltip. The React package adds FloatingTooltip for one trigger and FloatingTooltipGroup for many.
| Name | Description |
|---|---|
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-template | Marks a trigger. The first holds the hint as text, the second names the id of a template to clone. |
selector | Which elements count as triggers. Both attributes above by default. |
side, sideOffset | Where the popup sits from the pointer, such as "bottom-right" or "top", and how far away. Bottom right and 10 px by default. |
tilt | Leans the popup by up to this many degrees while the pointer moves. 5 by default, 0 turns it off. |
delay, closeDelay | The 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. |
className | Added to the popup, for your own styles. |
track, viewportPadding | Follow the pointer or stay on the trigger, per axis, and the margin kept from the window edges. |
FloatingTooltip, FloatingTooltipGroup | The React components: one trigger with a content string, or a group that takes the same options. tooltipClassName sets the popup's class. |