> For AI agents: the complete documentation index is available at https://rspress.rs/zh/llms.txt, the full documentation bundle is available at https://rspress.rs/zh/llms-full.txt.

# Head

Head 组件用于向文档页面插入自定义 head 内容（基于 [unhead](https://www.npmjs.com/package/unhead)）。

如果你更习惯用对象形式声明 head，或者需要基于组件状态、props 计算 head 内容，可以使用 [`useHead`](https://rspress.rs/zh/ui/hooks/use-head.md) hook。

## 用法

```mdx title="index.mdx"
import { Head } from '@rspress/core/runtime';

<Head>
  <meta property="og:description" content="Out-of-box Rspack build tools" />
  <link rel="canonical" href="https://example.com" />
</Head>
```


可在 MDX 或 React 页面中添加 meta 标签、canonical、Open Graph、favicon 等头部信息。
