> This page is for 文档.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# Frame

> 使用 Fern 的 Frame 组件在您的文档中显示带标题的图片。包括细微的背景变体和属性。

`<Frame>` 组件为图片和其他媒体提供容器，支持可选的标题和背景。

## 用法

![Sample photo of mountains](https://images.pexels.com/photos/1867601/pexels-photo-1867601.jpeg)

**`Markdown`**

```jsx Markdown
<Frame caption="美丽的山脉">
  <img src="./path/to/image.jpg" alt="Sample photo of mountains"/>
</Frame>
```

## 变体

### 细微背景

![Sample photo of mountains](https://images.pexels.com/photos/1867601/pexels-photo-1867601.jpeg)

**`Markdown`**

```jsx Markdown
<Frame caption="美丽的山脉" background="subtle">
  <img src="./path/to/image.jpg" alt="Sample photo of mountains"/>
</Frame>
```

## 属性

**`caption`** `string`

显示在框架下方的标题文本

---

**`background`** `'subtle' | 'default'` — default: 'default'

为框架添加细微背景。使用 "subtle" 获得更柔和的外观。

---

**`className`** `string`

应用于框架的额外 CSS 类

---