> For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt.

# rich-text

富文本组件，支持 HTML 字符串或结构化节点，并自动同步内容高度。写法与小程序 rich-text 兼容。

<iframe src="https://developer.doubao.com/docs-preview/component-simulator/?caseId=rich-text"
  title="组件示例 rich-text"
  width="100%"
  height="700"
  loading="lazy"
  style="width:100%;height:700px;border:0;border-radius:16px;overflow:hidden;"
></iframe>

## 扫码预览

![扫码预览 rich-text](https://api.qrserver.com/v1/create-qr-code/?size=200x200\&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fcomponent%252Frich-text%252Findex)

## Props

<table>
<thead>
<tr><th width="140">属性名</th><th width="240">类型</th><th width="120">默认值</th><th width="80">必填</th><th width="360">说明</th></tr>
</thead>
<tbody>
<tr><td>className</td><td><code>string</code></td><td>-</td><td>否</td><td>外层容器的类名。</td></tr>
<tr><td>nodes</td><td><code>string | RichTextNode[]</code></td><td>-</td><td>否</td><td>要渲染的内容，可传 HTML 字符串或结构化节点数组。<br>白名单外的节点和属性会先被移除，再交给底层渲染。</td></tr>
<tr><td>space</td><td><code>RichTextSpace</code></td><td>-</td><td>否</td><td>文本节点中的普通空格如何转换。</td></tr>
<tr><td>style</td><td><code>string | CSSProperties</code></td><td>-</td><td>否</td><td>外层容器的内联样式。</td></tr>
</tbody>
</table>
