Component description

The table-of-contents component automatically generates a table of contents based on the headings present on the page. If there are no headings on the page, the component will be hidden.

Example

Minimal JSON

{
  "type": "table-of-contents"
}
{
  "type": "table-of-contents",
  "componentId": "document#table-of-contents#content",
  "lookupAttributeTypeKey": "content",
  "lookupHeadings": [
    "h1",
    "h2",
    "h3"
  ]
}

Example taken from the core_documentation package.

Nested properties

PropertyDescriptionValuesMandatory
typetable-of-contentsstringYes
lookupHeadingsList of heading levels (h1 to h6) to include in the table of contents.array of stringsYes
componentIdUnique ID of a component. If left empty, a random string will be generated. Primarily used in patch packages to define the component's position within the layout (template).stringNo
lookupAttributeTypeKeyKey of the attribute type that contains the text used to generate the table of contents.stringNo