Table of Contents
Starlight
Section titled “Starlight”Starlight already has this feature, so no additional work is required. However, you can override the default one ↗.
”Snake” Table of Contents
Section titled “”Snake” Table of Contents”See:
- https://kld.dev/building-table-of-contents/ ↗
- https://kld.dev/toc-animation/ ↗
- fumadocs toc-clerk.tsx ↗
Implementation
Section titled “Implementation”Check out the source code to see how to implement it:
- Fix “snake” styles.
Starlight-Specific Config
Section titled “Starlight-Specific Config”-
Create
TableOfContents
componentsrc/components/TableOfContents.astro ---import TOC from "./TOC.astro";---<TOC {...Astro.props} /> -
Configure Astro
astro.config.mjs export default defineConfig({integrations: [starlight({components: {TableOfContents: "./src/components/TableOfContents.astro",},}),],});