文档索引
以原生链接和可选的视图控件提供分组文档导航。
分组条目
Learn 2
Start with one complete example, then build on it.
Utilities 4
Look up a specific layout behavior.
Foundations 2
Share values across the interface.
在指南中
Learn 2
Start with one complete example, then build on it.
Utilities 4
Look up a specific layout behavior.
Foundations 2
Share values across the interface.
使用于 the Guide index.
用法与接口
DocumentationIndex 按章节、分类或字母整理大型目录,作为 Guide 与 Reference 的入口。学习路径应使用完整说明,按名称查找 API 或 utility 则使用精简链接列表。两种视图包含相同的目标。
每个章节应提供稳定的 id、标题、说明与 groups;章节按顺序编号。具有多个分类的分组会在章节标题旁显示原生锚点快捷链接;每个分组都应有自己的稳定 id,让分享网址在重新排序后仍然有效。showDescriptions 启用完整、可换行的摘要;默认使用精简链接。related 提供前往另一份目录的链接。
<DocumentationIndex name="guide" sections={[{ id: 'learn', title: 'Learn', description: 'Start with a working example.', groups: [{ entries: [{ id: 'intro', title: 'Introduction', category: 'Guide', description: 'Write your first classes.', url: 'https://rc.css.master.co/guide/introduction', }] }], }]} showDescriptions related={{ href: 'https://rc.css.master.co/reference', title: 'Reference', description: 'Look up a utility.' }}/>目录以书籍目录的方式阅读:先以细线呈现编号章节目录,并以交叉链接收尾;再将各章节排成带分隔线的跨页形式,从 44rem 起,编号、名称与摘要会保留在条目旁。有说明的条目是带分隔线的行,指针移入时显示箭头;精简链接以多列排列;A–Z 视图则像书末索引般按字母分列。整体不使用框架,手机上的触控行保持 44px。组件自带容器与列布局,应放在阅读栏中、测量示例之外。分类与 A–Z 控件是带有按下状态的原生按钮;字母与分类快捷链接是真实片段链接,也支持直接进入的网址。公开目录省略 idPrefix 以保留原有锚点;只有同一查看页显示多份目录时,才设置不同前缀。完整分类视图会包含在服务器渲染的 HTML 中,A–Z 切换则需要 JavaScript。索引查看页呈现当前的目录。