Skip to content
LoidoltTheme 0.11.1
Svelte 5

Component

TableOfContents

The headings of a page, marking the one being read.

import { TableOfContents } from '@loidolt/theme-docs';

Example

Prepare the file

Export vectors at 1:1 and close every cut path.

Choose a material

Only use stock from the approved shelf.

Run the job

Frame the job, start the extraction, then start the cut.

Before you leave

Wait for the extraction to clear the bed.

Calibration

Focus is checked each morning.

Notes

  • The current heading is aria-current="location". Scroll tracking looks only inside container, and stops when unmounted.

Props

Generated from the component source, so it cannot drift from the implementation.

TableOfContents props
PropTypeDefaultNotes
items required TocItem[]—The headings to list — toc from renderMarkdown.
activeId bindablestring | nullnullThe heading being read. Bindable; follows scrolling.
class string—
container HTMLElement | nullnullWhere the headings are. Scroll tracking only looks inside it. Defaults to the document.
offset number72Space at the top of the viewport that hides content, e.g. a sticky header, in pixels. A heading counts as current once it clears it.
onNavigate (item: TocItem) => void—A link was followed — TocPanel closes its drawer on this.
ref bindableHTMLElement | nullnull
title string'On this page'Names the list; shown above it.

Plus the attributes of HTMLAttributes<HTMLElement>, forwarded to the root element.