···11+---
22+title: TableOfContents
33+description: A table of contents component that displays a navigation tree based on document headings and automatically highlights the currently visible section.
44+---
55+66+import { PropDocs } from '../../../lib/PropDocs'
77+import { Example } from '../../../lib/Example'
88+import { Basic } from '../../../examples/table-of-contents/basic'
99+1010+<Example src={Basic} noPadding />
1111+1212+## Installation
1313+1414+Run the following command to add the table of contents component to your project.
1515+1616+```bash
1717+pnpm hip install table-of-contents
1818+```
1919+2020+## Props
2121+2222+<PropDocs components={["TableOfContents"]} />
2323+2424+## Related Components
2525+2626+- [Sidebar](/docs/components/navigation/sidebar) - For navigation menus
2727+- [Breadcrumbs](/docs/components/navigation/breadcrumbs) - For showing navigation path
2828+- [Link](/docs/components/navigation/link) - For navigation links
2929+- [Content](/docs/components/content/content) - For document content layout
3030+