use-intersection
Get information about intersection of given element with its scroll container
Import
Source
Docs
Package
Usage
Use hook to get information about intersection of given element with its scroll container or body element with Intersection Observer API:
Obscured
API
Hook accepts IntersectionObserver
's options as its only optional argument:
Hook returns ref function that should be passed to the observed element, and the latest entry, as returned by IntersectionObserver
's callback.
See Intersection Observer API documentation to learn everything about options.
On the first render (as well as during SSR), or when no element is being observed, the entry is null
.
Definition
Feedback
Your feedback is most valuable contribution to the project, please share how you use Mantine, what features are missing and what is done good
Leave feedback