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
version3.20.0
usageimport {useOverlayPosition} from 'react-aria'

API#


useOverlayPosition( (props: AriaPositionProps )): PositionAria

Example#


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