Positioner

View on GitHub

Introduction

The Positioner component is a utility component to help with positioning an element to an anchor. It is used as a helper component throughout Evergreen in components such as Tooltip and Popover.

Positioner Props

positionenum = Position.BOTTOM
The position the element that is being positioned is on. Smart positioning might override this.
isShownbool
When true, show the element being positioned.
childrenfuncrequired
Function that returns the element being positioned.
innerReffunc = () => {}
Function that returns the ref of the element being positioned.
bodyOffsetnumber = 6
The minimum distance from the body to the element being positioned.
targetOffsetnumber = 6
The minimum distance from the target to the element being positioned.
targetfuncrequired
Function that should return a node for the target. ({ getRef: () -> Ref, isShown: Bool }) -> React Node
initialScalenumber = 0.9
Initial scale of the element being positioned.
animationDurationnumber = 300
Duration of the animation.
onCloseCompletefunc = () => {}
Function that will be called when the exit transition is complete.
onOpenCompletefunc = () => {}
Function that will be called when the enter transition is complete.