Finsweet's ToC.
Webflow doesn't make it easy to set the Current state on links, which makes styling FS ToC quite challenging.
Here's how I do it.
FS ToC doesn't run if their are no headings found in the rich text content, however this often means you'll see a ToC element of "Example H2" shown.
Here's how to suppress the ToC when there are no headings;
<script>
function hideTocTableIfNoHeadings() {
const richText = document.querySelector('[fs-toc-element="contents']'');
const headings = richText.querySelectorAll('h1, h2, h3, h4, h5, h6');
const tocTable = document.querySelector('[fs-toc-element="table"]');
if (headings.length === 0) {
tocTable.style.display = 'none';
}
}
hideTocTableIfNoHeadings();
</script>
https://forum.finsweet.com/t/table-of-contents/2182/6
To detect and perform tasks after the ToC has been constructed;
https://forum.finsweet.com/t/is-there-toc-setup-complete-event-callback/1664