Skip to Content
Kokonut UI

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.

Install with
no extra packages

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-index

Usage

import ScrollIndex from "@/components/kokonutui/scroll-index";

export default function Example() {
  return <ScrollIndex />;
}

Props

children
ReactNode

The content to index. Defaults to a sample article.

selector
stringDefault "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.

className
string

Extra classes for the root element.

Dependencies

NeedsVersionComes from
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.