# TableOfContents

> Island: a docs page's own headings as an "On this page" list, as a rail beside the prose or a sticky bar on a narrow screen.

```ts
import { TableOfContents } from "@sdxc/ui/docs";
```

Renders the in-page navigation, or nothing when the page has fewer than `minItems`
headings. Load `@sdxc/ui/docs/table-of-contents` in the browser entry. Headings that the
page's layout gives a `scroll-margin-top` set the line a section is read from.

## Examples

```tsx
<TableOfContents items={anchors} label="On this page" />
```

```tsx
<TableOfContents items={anchors} label="On this page" layout="bar" />
```

## Props

Takes no props of its own.
