Skip to content

Function: arrowOffsetAlong() ​

ts
function arrowOffsetAlong(
   elementStart, 
   elementEnd, 
   popoverStart, 
   popoverEnd, 
   arrowSize?, 
   align?
): number;

The arrow's offset along one popover edge, relative to the popover's leading edge. It aims at the middle of the stretch where element and popover overlap (or at the nearest corner when they do not overlap) and stays clear of the rounded corners. An element spanning the whole edge leaves the choice to the alignment, so the arrow echoes it.

Parameters ​

ParameterTypeDefault value
elementStartnumberundefined
elementEndnumberundefined
popoverStartnumberundefined
popoverEndnumberundefined
arrowSizenumberARROW_SIZE
alignAlignment"center"

Returns ​

number

Released under the MIT License.