Anchor
Table of contents for the page. Clicking marks the section current, and scrolling follows along.
Example
First section
Scroll down to see the marker follow.
Second section
You are here.
<Anchor
sections={[
{ id: "section-1", label: "First section" },
{ id: "section-2", label: "Second section" },
}}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
sections | Array<{ id, label }> | - | Targets by element id. |
label | string | On this page | Nav landmark name. |
Accessibility
- Links are real anchors: middle-click, open-in-tab, and keyboard all work.
- Current section is announced via
aria-current. - IntersectionObserver only flips the marker; it never moves focus.