Components
ResponseField
Document API response fields with name, type, and description in a structured layout.
Overview
The ResponseField component renders a single field in an API response schema. Each entry displays the field name, its type, an optional required badge, and a description. Stack multiple ResponseField components to document a full response object.
Example
idstringrequiredThe unique identifier for the resource.
created_atstringISO 8601 timestamp of when the resource was created.
metadataobjectAn optional key-value map of additional data attached to the resource.
Usage
Basic field
mdx
<ResponseField name="id" type="string">
The unique identifier for the resource.
</ResponseField>Required field
mdx
<ResponseField name="email" type="string" required>
The email address of the user. Must be unique across all accounts.
</ResponseField>Full response object
Stack multiple entries to document a complete response schema:
mdx
<ResponseField name="id" type="string" required>
Unique identifier for the user.
</ResponseField>
<ResponseField name="name" type="string" required>
Full display name of the user.
</ResponseField>
<ResponseField name="email" type="string" required>
Email address associated with the account.
</ResponseField>
<ResponseField name="role" type="'admin' | 'member' | 'viewer'">
The user's permission level within the workspace.
</ResponseField>
<ResponseField name="created_at" type="string">
ISO 8601 timestamp of when the account was created.
</ResponseField>
<ResponseField name="metadata" type="object">
Optional key-value pairs of additional data attached to the user.
</ResponseField>
Props
| Prop | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The field name displayed in monospace. |
type | string | Yes | The field's type annotation, e.g. string, number, object. |
required | boolean | No | When present, displays a red required badge next to the type. |
children | React.ReactNode | Yes | Description of the field and its expected values or behavior. |
Accessibility Notes
- Field names and types are rendered in
<code>and monospace text for clarity. - The
requiredbadge uses both color and text to convey requirement status — it is not color-only. - For deeply nested response schemas, consider using
ResponseFieldalongsideExpandableto progressively disclose nested fields.
Was this page helpful?