DemoSection
文档示例区块组件,用于在组件文档中展示可运行示例及其对应源代码
Component Demo
Basic usage and examples of the DemoSection component
基础用法
这是示例内容
查看代码
点击右上角「查看代码」切换代码展示
标题层级
三级标题
使用 level=3 呈现更小的三级标题
交互内容
计数:0
API Documentation
Complete API reference for the DemoSection component
Props
| 属性名 | 类型 | 默认值 | 描述 |
|---|---|---|---|
children | ReactNode | - | 示例预览区域的内容 |
className | string | - | 自定义类名 |
code | string | - | 示例代码(Markdown 或纯代码字符串) |
codeLanguage | string | 'tsx' | 示例代码语言 |
id | string | - | 示例区块锚点 id |
level | TocLevel | 2 | 标题层级(2 或 3) |
title | string | - | 示例标题(必填) |