Skip to content

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

PropTypeDefaultDescription
sectionsArray<{ id, label }>-Targets by element id.
labelstringOn this pageNav landmark name.

Accessibility