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

# theme-provider

主题配置组件，为其包裹的子组件统一指定豆包的浅色 / 深色模式。

只影响颜色相关的 CSS 变量，不涉及圆角、间距、字号等其他样式。

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

## 扫码预览

![扫码预览 theme-provider](https://api.qrserver.com/v1/create-qr-code/?size=200x200\&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fcomponent%252Ftheme-provider%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>children</td><td><code>ReactNode</code></td><td>-</td><td>否</td><td>子元素，会继承本组件设置的豆包主题颜色变量。</td></tr>
<tr><td>className</td><td><code>string</code></td><td>-</td><td>否</td><td>容器类名</td></tr>
<tr><td>flatten</td><td><code>boolean</code></td><td>false</td><td>否</td><td>是否展平容器 view。默认 false，因为该 view 需要作为 CSS 变量的作用域存在。</td></tr>
<tr><td>id</td><td><code>string</code></td><td>-</td><td>否</td><td>容器 id</td></tr>
<tr><td>style</td><td><code>CSSProperties</code></td><td>-</td><td>否</td><td>容器样式</td></tr>
<tr><td>theme</td><td><code>Theme</code></td><td>-</td><td>否</td><td>子树使用的主题。未传时跟随最近的上层 theme-provider；没有上层 theme-provider 时，跟随豆包当前主题。</td></tr>
</tbody>
</table>
