Skip to content

1681-engine / ui / placeTooltip

Function: placeTooltip() ​

ts
function placeTooltip(
   anchor, 
   tip, 
   viewport, 
   options?
): TooltipPlacement;

Defined in: src/ui/layout/placeTooltip.ts:42

Where a tooltip of tip size goes beside anchor: on the preferred side when it fits, flipped to the opposite one when it does not, the roomier of the two when neither does; then slid along the edge to stay on screen.

Parameters ​

ParameterType
anchorRect
tipSize
viewportSize
optionsTooltipOptions

Returns ​

TooltipPlacement

Released under the MIT License.