Skip to content
zenui/react-hooks

useScrollSpy

Return the id of the section currently in view, based on IntersectionObserver. Use it to highlight the active link in a table of contents or a sticky nav.

Level
Intermediate
Since
v2.1.0
import {useScrollSpy} from '@zenuilabs/react-hooks';
Loading demo_

More in Events & DOM