TOC
Table of Content
A Table of Contents with active anchor observer and auto scroll.
Usage
TOC Provider
Contains all anchor items. By default, it automatically scrolls to the active anchor.
Prop | Type | Description |
---|---|---|
toc | TableOfContents | Table of contents |
children | ReactNode | - |
TOC Item
The anchor element.
Prop | Type | Description |
---|---|---|
href | string | The url of TOC item |
Data Attribute | Values | Description |
---|---|---|
data-active | true, false | Is active anchor |
Use Active Anchor
A hook for getting the active anchor. It accepts the item url and return a boolean value, must be called under the TOC Provider.
Useful for implementing advanced styling.
Last updated on