EnhanceTocOptions: {
    contentSelector?: string;
    headings?: string;
    onValueChange?: (value: string | null) => void;
    scrollSpy?: boolean;
    watch?: boolean;
}

Options for enhanceToc.

Type declaration

  • OptionalcontentSelector?: string

    Selector for the region whose headings populate the list. Defaults to main, article.

  • Optionalheadings?: string

    Selector for which headings to include. Defaults to h2,h3.

  • OptionalonValueChange?: (value: string | null) => void

    Called with the id of the heading in view whenever it changes.

  • OptionalscrollSpy?: boolean

    Highlight the entry for the heading currently in view. Defaults to true.

  • Optionalwatch?: boolean

    Rebuild the list automatically when the content region changes. Defaults to true.