useOverlayPosition

Handles positioning overlays like popovers and menus relative to a trigger element, and updating the position when the window resizes.

installyarn add @react-aria/overlays
version3.7.3
usageimport {useOverlayPosition} from '@react-aria/overlays'

API#


useOverlayPosition( (props: AriaPositionProps )): PositionAria

Example#


See useOverlayTrigger for an example of using useOverlayPosition to position a popover relative to its trigger button.