Put the links in nested lists, and the track last in the outer list.
docs-contents.tsx
TrackContents
<div>| 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 | — | 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 | — | 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 | — | The scroll box that holds the headings, if it is not the page (an element, not a ref). |
| nodes | boolean | false | Draws a 5px dot on the track for each heading: hollow ahead, faint when read, full in view. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
TrackContentsTitle
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
TrackContentsList
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
TrackContentsItem
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
TrackContentsLink
<div>| 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 | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
TrackContentsTrack
<li>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <li> attributes | — | Every other attribute goes to the <li>, with a ref. |
| Tab | Moves to the next heading link. |
|---|---|
| Enter | Goes to the heading. |
Built with
Installs with Track Contents
- Components
- Table of Contents











