Toc

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

Table of Contents

APIs

NameDescriptionTypeDefault
isMobileWhether the component is being rendered on a mobile device or notbooleanfalse
activeKeyThe active key of the TocMobile componentstringnull
getContainerThe function to get the container of the anchor()=>HTMLElement|Window--
headerHeightThe height of the headernumber64
itemsThe array of anchor items to be displayedAnchorItem[](required)
onChangeThe function to be called when the active key changes(activeKey:string)=>void--
tocWidthThe width of the tocnumber176