Basic Table of Contents
Table of Contents is a list of anchor links that match the section headings of an article or page.
Important Notes:
Each item’s url should match the id of the particular section container or section heading.
Demo
Twig
{% include '@bolt-components-toc/toc.twig' with {
items: [
{
text: 'Section One',
url: '#section-one',
},
{
text: 'Section Two',
url: '#section-two',
},
{
text: 'Section Three',
url: '#section-three',
},
{
text: 'Section Four',
url: '#section-four',
},
{
text: 'Section Five',
url: '#section-five',
},
]
} only %}
HTML
<bolt-toc>
<bolt-toc-item url="#section-one">
Section One
</bolt-toc-item>
<bolt-toc-item url="#section-two">
Section Two
</bolt-toc-item>
<bolt-toc-item url="#section-three">
Section Three
</bolt-toc-item>
<bolt-toc-item url="#section-four">
Section Four
</bolt-toc-item>
<bolt-toc-item url="#section-five">
Section Five
</bolt-toc-item>
</bolt-toc>