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
| Property | Description | Values | Mandatory |
|---|---|---|---|
type | table-of-contents | string | Yes |
lookupHeadings | List of heading levels (h1 to h6) to include in the table of contents. | array of strings | Yes |
componentId | Unique 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). | string | No |
lookupAttributeTypeKey | Key of the attribute type that contains the text used to generate the table of contents. | string | No |