Skip to content

A flexible Table of Contents (ToC) generator component for Astro. Perfect for blogs, documentation, or any content-rich page which benefits from in-page navigation

License

Notifications You must be signed in to change notification settings

theisel/astro-toc

Repository files navigation

astro-toc logo

astro-toc

npm build license

A flexible and customizable Table of Contents (ToC) generator component for Astro. Automatically builds nested navigation from your data, perfect for blogs, documentation, and content-rich sites.

 

✨ Features

  • Generates semantic, nested lists (ul, ol, menu).
  • Supports custom Astro components for rendering items via the use prop.
  • Control over minimum (depth) and maximum (maxDepth) levels shown.
  • Accepts standard HTML attributes (class, data-*, etc.) for styling the container.
  • Fully typed with TypeScript.

 

📦 Package Documentation

astro-toc usage instructions, examples, and the full API reference can be found in its dedicated README:

View Package README →

 

🚀 Demo

Give astro-toc a try on:

Open in StackBlitz Open in CodeSandbox

 

📄 License

Licensed under the ISC License.

About

A flexible Table of Contents (ToC) generator component for Astro. Perfect for blogs, documentation, or any content-rich page which benefits from in-page navigation

Topics

Resources

License

Stars

Watchers

Forks