Version: 2.0.0-alpha.71 🚧
Inline TOC
Each markdown document displays a tab of content on the top-right corner.
But it is also possible to display an inline table of contents directly inside a markdown document, thanks to MDX.
#
Full table of contentsThe toc
variable is available in any MDX document, and contain all the top level headings of a MDX document.
#
Custom table of contentsThe toc
props is just a list of table of contents items:
You can create this TOC tree manually, or derive a new TOC tree from the toc
variable:
caution
The underlying content is just an example to have more table-of-contents items available in current page.
#
Example Section 1Lorem ipsum
#
Example Subsection 1 aLorem ipsum
#
Example Subsection 1 bLorem ipsum
#
Example Subsection 1 cLorem ipsum
#
Example Section 2Lorem ipsum
#
Example Subsection 2 aLorem ipsum
#
Example Subsection 2 bLorem ipsum
#
Example Subsection 2 cLorem ipsum
#
Example Section 3Lorem ipsum
#
Example Subsection 3 aLorem ipsum
#
Example Subsection 3 bLorem ipsum
#
Example Subsection 3 cLorem ipsum