An On this page list that follows the reader through the sections of a page or a scroll area, and the useScrollspy hook behind it.
Scrollspy sidebar
Install
npx shadcn add @syncrobotic/scrollspy Also installs: @syncrobotic/cn
Overview
When to use
- Long settings or detail pages.
- Docs pages.
- A robot's detail panel with many sections.
Use something else
- Separate views people switch between: Tabs.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Scrollspy pills
Scrollspy hook only
Scrollspy no title
Scrollspy settings
Scrollspy long names
Usage rules
- Each section needs an id and a heading.
- Pass root when the page scrolls inside a container.
- Hide the rail on phones, or use the pills variant.
Changelog
- 0.15.02026-11-19Links show keyboard focus again.
- 0.10.02026-11-18Chips use radius 8.
- 0.9.02026-11-17New.