File: useoverlaylistener.md | Updated: 11/15/2025
Introducing PrimeReact v11 Alpha 🥁Learn More
SearchK
10.9.7
HOOK
API
Composition of commonly used overlay hooks.
Import#
import { useOverlayListener } from 'primereact/hooks';
Copy
Basic#
This hook combines the features of useClickOutside , useOverlayScrollListener and useResizeListener to handle popups positioned relative to another element.
Show
const [bindOverlayListener, unbindOverlayListener] = useOverlayListener({
target: buttonRef.current,
overlay: overlayRef.current,
listener: handleScroll,
options: { passive: true },
when: visible
});
Copy
Import
Basic
PrimeReact 10.9.7 by PrimeTek