Skip to main content
CodivDocs

ParamField

Document API request parameters — path, query, header, body — with type, default, enum, and deprecated states.

Usage

<ParamField> documents a single API parameter. Stack several together to describe an endpoint's full input contract.

<ParamField name="projectId" type="string" required path="path">
  The UUID of the project. Copy it from the dashboard URL.
</ParamField>

<ParamField name="limit" type="number" default="20" path="query">
  Number of results per page. Maximum 100.
</ParamField>
projectIdstringpathrequired

The UUID of the project. Copy it from the dashboard URL.

limitnumberquerydefault: 20

Number of results per page. Maximum 100.

Parameter location badge

Set the path prop to show where the parameter lives in the request. The badge appears next to the type and helps readers parse a busy endpoint at a glance.

ValueRenders as
"path"small uppercase PATH badge
"query"QUERY badge
"header"HEADER badge
"body"BODY badge
<ParamField name="Authorization" type="string" required path="header">
  Bearer token from your dashboard.
</ParamField>

<ParamField name="name" type="string" required path="body">
  The new project name shown in the sidebar.
</ParamField>
Authorizationstringheaderrequired

Bearer token from your dashboard.

namestringbodyrequired

The new project name shown in the sidebar.

Enum options

Pass an enum array to render the allowed values inline below the description:

<ParamField name="theme" type="string" enum={["light", "dark", "system"]} default="system">
  The default theme for visitors arriving without a saved preference.
</ParamField>
themestringdefault: system

The default theme for visitors arriving without a saved preference.

options:lightdarksystem

Deprecated parameters

Mark a parameter as deprecated to strikethrough the name and add a warning badge:

<ParamField name="legacyId" type="string" deprecated>
  Use `id` instead. This parameter will be removed in v2.
</ParamField>
legacyIdstringdeprecated

Use id instead. This parameter will be removed in v2.

Default value

The default prop is rendered as inline metadata next to the type and badge:

<ParamField name="page" type="number" default="1" path="query">
  Page number to fetch.
</ParamField>

Auto-generation from OpenAPI

If your project has an OpenAPI spec configured via api.openapi, ParamField entries are generated automatically on the API reference pages — you don't need to write them by hand. See the OpenAPI integration guide for details. Manually-written ParamField components are still useful for examples in concept pages and tutorials.

Props

PropTypeRequiredDescription
namestringYesParameter name as it appears in the request
typestringNoType annotation (e.g. string, number, UUID, MyEnum[])
requiredbooleanNoAdds a red "required" label
defaultstringNoDefault value when the parameter is omitted
deprecatedbooleanNoStrikethrough name + "deprecated" badge
enumstring[]NoAllowed values rendered as inline pills
path"path" | "query" | "header" | "body"NoWhere the parameter lives in the request

For documenting response fields, use <ResponseField> — it's the output twin.

Last updated April 12, 2026