NV-08Navigation
Scroll Index
A section rail for long pages, with a tick per heading that you can hover, click or drag to scrub, built with React.
PRODocs Search and more like it are in Kokonut UI Pro
Installation
Scroll Index is a free, open-source React component in the Kokonut UI Navigation collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/scroll-index.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/scroll-indexUsage
import ScrollIndex from "@/components/kokonutui/scroll-index";
export default function Example() {
return <ScrollIndex />;
}Props
childrenReactNodeThe content to index. Defaults to a sample article.
selectorstringDefault "h2, h3"Which headings get a tick.
scroller"self" | "window"Default "self"self: the component scrolls its own box (default). window: the page scrolls and the rail sticks beside the content.
classNamestringExtra classes for the root element.
Dependencies
| Needs | Version | Comes from |
|---|---|---|
cn from lib/utils.ts | shadcn init | |
| React | 19 | Your app |
| Tailwind CSS | 4 | Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.

