TOC
Table of Content
A Table of Contents with active anchor observer and auto scroll.
Usage
Anchor Provider
Watch for the active anchor using the Intersection API.
Prop | Type | Default |
---|---|---|
children? | ReactNode | - |
single? | boolean | true |
toc | TableOfContents | - |
Scroll Provider
Scrolls (the given scroll container) to the active anchor.
Prop | Type | Default |
---|---|---|
children? | ReactNode | - |
containerRef | RefObject<HTMLElement | null> | - |
TOC Item
The anchor item to jump to the anchor.
Data Attribute | Values | Description |
---|---|---|
data-active | true, false | Is anchor active |
Example
How is this guide?