Atelier UI

搜索组件…

搜索组件…

Table of Contents

目录导航:随滚动高亮当前章节,点击平滑跳转,支持多级缩进。

在沙盒中编辑

复制一段给 AI 编程工具的提示词,包含源码、依赖和用法

属性

TableOfContentsProps

同时支持以下类型的全部属性: Omit<React.ComponentProps<"nav">, "children" | "title">

属性类型默认值说明
headings* 必填TocHeading[]——
titlestring"On this page"—
scrollTargetReact.RefObject<HTMLElement | null>—Scroll container the headings live in; the window when omitted
offsetnumber24Distance from the top of the container at which a heading counts as current

安装

$ npx shadcn@latest add https://chromotion.dev/r/table-of-contents.json

同类组件