Introduction
Some intro copy here.
Installation
Steps to install.
Peer dependencies
Nested headings bend the rail across with a rounded elbow.
Usage
How to use the component.
Auto-generated "On this page" navigation that tracks every heading currently on screen. Powers the right rail of every UI Library doc page, plus the sticky collapsible bar you see on mobile.
Point it at a container; ScrollSpy finds h2-h6 inside and renders a nav. Every heading that is visible lights up at once, and the rail spans the whole range. Nested headings indent and the rail bends across to meet them.
Import the parts you need from the component's folder.
import { ScrollSpy, ScrollSpyPopover } from "@/components/ui/scroll-spy";Keyboard shortcuts and ARIA behavior.