> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.manicule.dev/zh/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://mintlify.manicule.dev/zh/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://mintlify.manicule.dev/api/mcp.
> Every agent surface: https://mintlify.manicule.dev/.well-known/llms-manifest.json

# 图标 (/zh/components/icons)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 486 · updated: 2026-07-31 -->
Related: [折叠面板](/zh/components/accordions.md), [徽章](/zh/components/badge.md), [横幅](/zh/components/banner.md), [标注框](/zh/components/callouts.md), [卡片](/zh/components/cards.md), [代码分组](/zh/components/code-groups.md)

> 使用图标组件将 Font Awesome、Lucide、Tabler 或自定义来源的图标添加到文档页面，支持尺寸和颜色选项。

使用来自 Font Awesome、Lucide、Tabler、SVG、外部 URL 或项目文件的图标，丰富你的文档。

<Icon icon="flag" size="32" />

```mdx title="Icon example"
<Icon icon="flag" size={32} />
```

## 自定义图像图标

使用 `src` 属性将自定义图像显示为图标。该图像可以是项目中的文件，也可以是外部托管的 URL。

```mdx title="Custom image icon examples"
<Icon src="/images/my-icon.svg" />

<Icon src="https://example.com/icon.png" />
```

<div id="inline-icons">
  ## 行内图标
</div>

当在句子、段落或标题中使用时，图标会以内联形式呈现。 <Icon icon="flag" iconType="solid" /> 你可以将图标用于装饰，或用于强化视觉重点。

```markdown title="Inline icon example"
图标在句子、段落或标题中使用时会内联显示。<Icon icon="flag" iconType="solid" /> 使用图标可以起到装饰作用或增强视觉效果。
```

<div id="properties">
  ## 属性
</div>

<Info>必须提供 `icon` 或 `src` 之一。</Info>

<ResponseField name="icon" type="string">
  要从图标库中显示的图标。

  可选值：

  * 如果在 `docs.json` 中将 `icons.library` [属性](/zh/organize/settings#param-icons) 设置为 `fontawesome`，则为 [Font Awesome 图标](https://fontawesome.com/icons) 的名称
  * 如果在 `docs.json` 中将 `icons.library` [属性](/zh/organize/settings#param-icons) 设置为 `lucide`，则为 [Lucide 图标](https://lucide.dev/icons) 的名称
  * 如果在 `docs.json` 中将 `icons.library` [属性](/zh/organize/settings#param-icons) 设置为 `tabler`，则为 [Tabler 图标](https://tabler.io/icons) 的名称
</ResponseField>

<ResponseField name="src" type="string">
  用作图标的图像的路径或 URL。当你希望使用自定义图像而不是图标库中的图标时，请使用 `src` 代替 `icon`。

  可选值：

  * 项目中图像文件的路径（例如，`/images/my-icon.svg`）
  * 外部托管图像的 URL（例如，`https://example.com/icon.png`）
</ResponseField>

<ResponseField name="iconType" type="string">
  [Font Awesome](https://fontawesome.com/icons) 的图标样式。仅在使用 Font Awesome 图标时有效。

  可选值：`regular`、`solid`、`light`、`thin`、`sharp-solid`、`duotone`、`brands`。
</ResponseField>

<ResponseField name="color" type="string">icon 的颜色，使用十六进制色值（例如 `#FF5733`）。</ResponseField>

<ResponseField name="size" type="number">icon 的尺寸（像素）。</ResponseField>

<ResponseField name="className" type="string">应用于 icon 的自定义 CSS 类名。</ResponseField>
