IsInViewport
Track if an element is visible within the current viewport.
IsInViewport
uses the useIntersectionObserver
utility to track if an element is visible within the current viewport.
It accepts an element or getter that returns an element and an optional options
object that aligns
with the useIntersectionObserver
utility options.
Demo
Target node
Scroll down to observe the behavior
Target node is
viewport