Overview

This component provides automatic scroll-spy tracking for long documents.

Installation

Import the layout package and call TableOfContents with optional items.

Usage

Pass TOCItem slices or leave empty for auto-detection from headings.

Variants

Sticky mode keeps the TOC visible while scrolling the content.

Props

ContentSelector targets a CSS selector for the heading observation root.

Advanced

Pass no items to auto-populate from h2/h3/h4 elements in the target container.