A scroll-spy table of contents with an animated spine that tracks reading progress.
Drop the component next to any scrollable article and pass heading links as items.
Install once, then import the TOC wherever long-form content lives.
Works with window scroll, docs wrappers, or any scrollable ancestor.
Scroll the article — the dot glides down and back up with direction-aware progress.
Each link smooth-scrolls its section into view inside the same container.
The active link highlights as its section crosses the top threshold.
Pass items as { url, title, depth } — depth controls the spine indent.
Style via .toc, .toc-list, .toc-link and the active .toc-active state.
Click, scroll and resize are handled with rAF-throttled listeners.
Try the live article on the left — drag the scrollbar both ways.
Reduced-motion users get an instant, non-animated position update.