The Toc component is used to display a table of contents with clickable anchor links to different sections of a page. It can be customized with a specific height and width, and can be displayed differently on mobile devices. The component utilizes the Ant Design Anchor component to create the clickable anchor links.
Default
APIs
Name | Description | Type | Default |
---|---|---|---|
isMobile | Whether the component is being rendered on a mobile device or not | boolean | false |
activeKey | The active key of the TocMobile component | string | null |
getContainer | The function to get the container of the anchor | ()=>HTMLElement|Window | -- |
headerHeight | The height of the header | number | 64 |
items | The array of anchor items to be displayed | AnchorItem[] | (required) |
onChange | The function to be called when the active key changes | (activeKey:string)=>void | -- |
tocWidth | The width of the toc | number | 176 |