guide

scroll-spy

An IntersectionObserver-driven active-section tracker — renders as a nav list on desktop, a select on mobile. Updates the URL hash for shareable links.

Overview

Use the list to jump between sections.

Active section

IntersectionObserver tracks a narrow band near the top.

Shareable links

Navigation updates the URL hash.

Scroll the panel — the active item follows. On narrow screens, the list becomes a select.

Installation

Usage

ScrollSpy: Root · List · Select