> 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.

# svg

SVG 图形渲染组件，支持内联展示 SVG 格式图片。

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

## 扫码预览

![扫码预览 svg](https://api.qrserver.com/v1/create-qr-code/?size=200x200\&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fcomponent%252Fsvg%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>content</td><td><code>string</code></td><td>-</td><td>否</td><td>SVG 内容字符串，直接传入 SVG XML 内容</td></tr>
<tr><td>id</td><td><code>string</code></td><td>-</td><td>否</td><td>元素的唯一标识</td></tr>
<tr><td>key</td><td><code>string | number | null</code></td><td>-</td><td>否</td><td>React key 属性</td></tr>
<tr><td>onClick</td><td><code>(event: TouchEvent) =&gt; void</code></td><td>-</td><td>否</td><td>点击时的回调函数</td></tr>
<tr><td>ref</td><td><code>Ref&lt;NodesRef&gt;</code></td><td>-</td><td>否</td><td>用于获取组件实例的 ref</td></tr>
<tr><td>src</td><td><code>string</code></td><td>-</td><td>否</td><td>SVG 资源地址，支持 http/https/base64</td></tr>
<tr><td>style</td><td><code>CSSProperties</code></td><td>-</td><td>否</td><td>组件样式</td></tr>
</tbody>
</table>
