ApiField
The <ApiField> component is the workhorse of your documentation. It is designed to cleanly display the keys, types, and descriptions of complex data objects and schemas.
You can use the component by importing it at the top of your .mdx file.
import ApiField from '@/components/docs/ApiField.astro';
<ApiField name="user_id" type="string" required>
The unique identifier for the user account.
</ApiField>Preview
Section titled “Preview”user_id string Required
The unique identifier for the user account. Must be a valid UUID v4.
preferences object Default:
{} Optional A nested object containing the user’s notification and theme settings.
Properties
Section titled “Properties”| Prop | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The name of the parameter or key. |
type | string | Yes | The data type (e.g., string, number, boolean, Array<string>). |
required | boolean | No | If true, displays a red “REQUIRED” badge. Defaults to false (displays “OPTIONAL”). |
defaultValue | string | No | Renders a small tag showing the default value if the key is omitted. |