# 响应字段 (/zh/components/responses)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 249 · updated: 2026-07-30 -->
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)

使用 `<ResponseField>` 组件来定义 API 的返回值。在需要列出某些对象的类型时，许多文档页面也会使用 `<ResponseField>`。

<ResponseField name="response" type="string">
  响应字段示例
</ResponseField>

```mdx
<ResponseField name="response" type="string" required>
  响应字段示例
</ResponseField>
```

<div id="props">
  ## 属性 [#属性]
</div>

<ResponseField name="name" type="string">
  响应值的名称。
</ResponseField>

<ResponseField name="type" type="string">
  响应值的预期类型——可以是任意字符串。
</ResponseField>

<ResponseField name="default" type="string">
  默认值。
</ResponseField>

<ResponseField name="required" type="boolean">
  在字段名旁显示“required”。
</ResponseField>

<ResponseField name="deprecated" type="boolean">
  指示你是否已废弃该字段。
</ResponseField>

<ResponseField name="pre" type="string[]">
  出现在字段名之前的标签
</ResponseField>

<ResponseField name="post" type="string[]">
  出现在字段名之后的标签
</ResponseField>

<RequestExample>
  ```mdx title="Response Field Example"
  <ResponseField name="response" type="string" required>
    响应字段示例
  </ResponseField>
  ```
</RequestExample>
