Visit kit.svelte.dev to read the documentation
Easily create table of contents.
Component | Slot | Html | Css | Description |
---|---|---|---|---|
PdfDocument | ✅ | ✅ | ✅ | The main pdf generation wrapper |
DynamicComponent | ✅ | ✅ | ✅ | Dynamic components that need to be created after the pagination |
Main PDF Document Wrapper
Name | Description | Optional | Default |
---|---|---|---|
options | The main options object | ||
style | The document size. One of A3, A4, A5, letter, legal | ✅ | A4 |
landscape | If the documents should be rendered in landscape | ✅ | false |
numbered | Defines if the chapter should be numbered, and if the number should be increased | ✅ | true |
Dynamic components that need to be created after the pagination
Name | Description | Optional | Default |
---|---|---|---|
componentId | The unique id of this component | ||
attributes | The properties that should be passed to the dynamic component | ✅ | {} |
Easily create table of contents.
Component | Slot | Html | Css | Description |
---|---|---|---|---|
Chapter | ✅ | Bare logic for adding chapters | ||
ChapterReference | ✅ | Bare logic referencing a chapter | ||
TableOfContents | ✅ | Bare logic for displaying a table of contents | ||
ChapterDefault | ✅ | ✅ | Implementation of Chapter, contains elements and styling | |
ChapterReferenceDefault | ✅ | ✅ | Implementation of ChapterReference, contains elements and styling | |
TableOfContentsDefault | ✅ | ✅ | Implementation of TableOfContents, contains elements and styling |
Implements logic for creating custom styled chapter components.
Name | Description | Optional | Default |
---|---|---|---|
name | The name or desceiption of the chapter | ||
key | Defines the unique key of the chapter. This key is used as an internal identifier. Aditionally this property could be used to create html ids | ||
includeInTableOfContents | Defines if the chapter should be visible in the table of contents | ✅ | true |
numbered | Defines if the chapter should be numbered, and if the number should be increased | ✅ | true |
Implements logic for referencing another chapter
Name | Description | Optional | Default |
---|---|---|---|
key | The unique key of the chapter created during the initialization of the chapter |
Implements logic for creating a table of contents
Name | Description | Optional | Default |
---|---|---|---|
chapters | (internal) A filtered list of chapters to display in table of contents | ✅ | undefined |
Implements logic, html and styling for creating a table of contents
Name | Description | Optional | Default |
---|---|---|---|
name | The name or desceiption of the chapter | ||
key | Defines the unique key of the chapter. This key is used as an internal identifier. Aditionally this property could be used to create html ids | ||
includeInTableOfContents | Defines if the chapter should be visible in the table of contents | ✅ | true |
numbered | Defines if the chapter should be numbered, and if the number should be increased | ✅ | true |
Implements logic, html and styling for referencing another chapter
Name | Description | Optional | Default |
---|---|---|---|
key | The unique key of the chapter created during the initialization of the chapter |
Implements logic, html and styling for creating a table of contents
Name | Description | Optional | Default |
---|---|---|---|
title | Heading displayed above the table of contents | ✅ | Table of Contents |
indentWidthInPx | Number of pixels to intend each child elments | ✅ | 15 |
startSizePt | Start size of the font in pt. Reduced by "decrementSize" for each child. | ✅ | 14 |
decrementSize | Number "startSizePt" will be reduced by for each child | ✅ | 1 |
depth | (internal) the current depth count | ✅ | 0 |
chapters | (internal) A filtered list of chapters to display in table of contents | ✅ | undefined |