Skip to main content

Table of Content (TOC)

Generates a linked table of contents from the page's own headings, with an optional collapsible toggle and progress dots tracking scroll position.

Props​

PropTypeDefaultNotes
titlestring"Table of content"Heading shown above the list.
maxLevelselect"h2"Deepest heading level included in the list.
offsetstring"40"Scroll offset (px) used when jumping to a heading, e.g. to clear a sticky header.
identifierstring—Used to scope which headings on the page get picked up.
showDotsbooleantrueShows progress dots next to each entry.
showTogglebooleantrueMakes the whole list collapsible.
(Toggle options)conditionshown when showToggle is on
toggle.expandedbooleantrueWhether the list starts expanded.
toggle.openTextstring"Open"Label shown on the toggle when collapsed.
toggle.closeTextstring"Close"Label shown on the toggle when expanded.
Note

This page covers the component's current props. A full walkthrough — like the one on Accordion — is coming as this component gets re-verified in an active conversion.