Skip to main content

Parameter Fields

2 min readStableIntermediate

ParamField documents one API request parameter: its name, type, where it travels (path, query, body, or header), whether it's required, its default value, and whether it's on the way out. Put a stack of them under an API block to describe a full request.

Quick Start

One required path parameter, with the description as the child content.

idstringpathrequired

The unique identifier for the resource.

app/features/api/param-fields.mdx
MDX
<ParamField name="id" type="string" location="path" required>
  The unique identifier for the resource.
</ParamField>

Adding Options

Add defaultValue and the field prints Default: followed by the value in inline code.

pageintegerqueryDefault: 1

Page number for paginated results.

limitintegerqueryDefault: 20

Maximum number of items to return.

app/features/api/param-fields.mdx
MDX
<ParamField name="page" type="integer" location="query" defaultValue="1">
  Page number for paginated results.
</ParamField>
 
<ParamField name="limit" type="integer" location="query" defaultValue="20">
  Maximum number of items to return.
</ParamField>

Advanced

deprecated strikes the name through and dims the whole block; body and header round out the four location badges. The last two show the extremes: every prop at once, then a field with nothing but a name — no type chip, no location badge, and no description line at all.

fieldsstringquerydeprecated

Comma-separated list of fields. Use the select parameter instead.

payloadobjectbodyrequired

JSON request body payload.

X-Request-Idstringheader

Correlation ID echoed back on the response.

sortstringqueryDefault: createdAtrequireddeprecated

Sort key. Retired in v3 — send order instead.

cursor
app/features/api/param-fields.mdx
MDX
<ParamField name="fields" type="string" location="query" deprecated>
  Comma-separated list of fields. Use the `select` parameter instead.
</ParamField>
 
<ParamField name="payload" type="object" location="body" required>
  JSON request body payload.
</ParamField>
 
<ParamField name="X-Request-Id" type="string" location="header">
  Correlation ID echoed back on the response.
</ParamField>
 
<ParamField
  name="sort"
  type="string"
  location="query"
  defaultValue="createdAt"
  required
  deprecated
>
  Sort key. Retired in v3 — send `order` instead.
</ParamField>
 
<ParamField name="cursor" />

Options

name is the only prop the component needs. Everything else is optional, and each one renders nothing at all when you leave it off.

namestringrequired

Parameter name, rendered in bold monospace.

typestring

Data type label shown in a small outlined chip next to the name. Any string works, so string | null and array of string are both fine.

locationstring

One of path, query, body, or header. Each gets its own badge color: sky, purple, teal, amber. Omit it and no badge renders.

requiredboolean

Adds a red "required" label after the badges. Leave it off and nothing renders — there's no "optional" label.

defaultValuestring

Printed after the badges as Default: plus the value in inline code. An empty string is treated as unset, so nothing renders.

deprecatedboolean

Adds an amber "deprecated" label, strikes through the name, and drops the whole block to 60% opacity. It stacks with required.

childrenReactNode

Description text under the field. Inline Markdown works here, and the description line is skipped entirely when there are no children.

ParamField is also what API blocks render internally for every query and header parameter, so anything documented here applies to those rows too. For response bodies, reach for Response Fields — same rendering, minus location and defaultValue.

Was this page helpful?