Atelier UI

Search components…

Search components…

Table of Contents

Scroll-spy outline that highlights the current section with smooth jump links and nested levels.

Edit in sandbox

Copy a prompt for your AI coding tool with the source, dependencies and usage

Props

TableOfContentsProps

Also accepts all props of Omit<React.ComponentProps<"nav">, "children" | "title">

PropTypeDefaultDescription
headings* requiredTocHeading[]——
titlestring"On this page"—
scrollTargetReact.RefObject<HTMLElement | null>—Scroll container the headings live in; the window when omitted
offsetnumber24Distance from the top of the container at which a heading counts as current

Install

$ npx shadcn@latest add https://chromotion.dev/r/table-of-contents.json

More like this