<Toc>
Component that renders the table of contents based on the data from TocProvider. Must be used inside a TocProvider.
| Prop | Type | Default | Description |
|---|---|---|---|
className? | string | - | CSS class applied to the outer <section> element. |
headingClassName? | string | - | CSS class applied to the optional heading (ex. “Contents”). |
headingText? | string | "Contents" | Text for the optional heading. |
headingVisible? | boolean | true | show/hide the heading above the TOC. |
listClassName? | string | - | CSS class applied to all <ul> elements in the TOC. |
linkClassName? | string | - | CSS class applied to all <a> links. |
activeClassName? | string | - | Additional CSS class applied to the active link. |
offsetTop? | number | 30 | Vertical offset applied when scrolling to a heading. |
offsetLeft? | number | 0 | Horizontal scroll offset when navigating to a heading. |
scrollBehavior? | "auto" | "instant" | "smooth" | "smooth" | Determines whether scrolling is instant or animates smoothly. |
expandAll? | boolean | false | If true, always show all nested levels. If false, only expand the branch containing the active heading. |
Last updated on