Founding price: $35, then $79.99 after 23:59 UTC on 4 November, then $79.99
Get ProAn "On this page" list that marks the section in view and scrolls to a heading when a link is chosen.
Derived from this item’s props table, because it declares no controls of its own. Changes drive the preview live.
import { TableOfContents } from "@/components/ui/table-of-contents"<TableOfContents className="sticky top-24" />| Prop | Type | Default | Description |
|---|---|---|---|
items | { id: string; title: string; level?: number }[] | - | Links to show. Leave out to collect headings automatically. |
headingsFrom | RefObject<HTMLElement | null> | <main> | Where to look for headings when items is not given. Falls back to the whole page. |
levels | number[] | [2, 3] | Heading levels to collect. |
title | string | "On this page" | Title above the list and accessible name of the <nav>. |
offset | number | 96 | Pixels reserved at the top for a sticky header; also where a section counts as reached. |
container | RefObject<HTMLElement | null> | - | Scrollable element to watch and scroll instead of the page. |
onNavigate | (id: string) => void | - | Called after the reader chooses a link. |
Also accepts all <nav> props except children.
aria-current="location". Nested levels are indented with logical padding, so the list works in RTL.