Put a list of links and the indicator in the root.
page-links.tsx
TableOfContents
<nav>| Prop | Type | Default | Description |
|---|---|---|---|
| aria-label | string | — | Defines a string value that labels the current element. The name of the landmark for screen readers. Default "On this page". Translate it. |
| value | string | null | — | The id of the current heading (controlled). Use with onValueChange. |
| default | string | null | null | The id that is current on the first paint, until the box scrolls or a click (uncontrolled). |
| on | — | Called with the new heading id on scroll and on a link click. | |
| offset | number | 0 | The height in px of a sticky header over the scroll box (default 0). Give the headings the same scroll-margin-top, so a jump to a hash lands under the header. |
| root | Element | null | null | The scroll box that holds the headings, if it is not the page (an element, not a ref). |
| track | boolean | false | Marks the links of the sections on screen with data-in-view (default false). |
| ...props | <nav> attributes | — | Every other attribute goes to the <nav>, with a ref. |
TableOfContentsTitle
<p>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <p> attributes | — | Every other attribute goes to the <p>, with a ref. |
TableOfContentsList
<ol>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <ol> attributes | — | Every other attribute goes to the <ol>, with a ref. |
TableOfContentsItem
<li>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <li> attributes | — | Every other attribute goes to the <li>, with a ref. |
TableOfContentsLink
<a>| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | — | The id of the heading. Default: the href without #. Set it when render mounts a router link that builds its own href (render={<Link to="/docs" hash="install" />}). |
From Base UIUseRenderBase UI docs | |||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| ...props | <a> attributes | — | Every other attribute goes to the <a>, with a ref. |
TableOfContentsIndicator
<li>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <li> attributes | — | Every other attribute goes to the <li>, with a ref. |
| Tab | Moves through the links. |
|---|---|
| Enter | Goes to the heading. |



