---
title: "content.fieldTypes"
description: "The x-content field types that the installed plugins implement."
canonical_url: "https://content.comark.dev/reference/content/field-types"
---
# content.fieldTypes

> The x-content field types that the installed plugins implement.

## `content.fieldTypes` {#contentfieldtypes}

The `x-content` field types that the installed plugins implement. Each plugin adds its field types with [`content.addFieldType()`](https://content.comark.dev/reference/content/add-field-type) during setup, so the set is complete as soon as the instance is created.

**Type:** `ReadonlySet<string>`

| Plugin                                                                                     | Field type              |
| ------------------------------------------------------------------------------------------ | ----------------------- |
| [`markdown-fields`](https://content.comark.dev/plugins/built-in/markdown-fields)           | `'markdown'`            |
| [`references`](https://content.comark.dev/plugins/built-in/references)                     | `'reference'`           |
| A [custom plugin](https://content.comark.dev/plugins/custom/plugin-api#custom-field-types) | The names it registers. |

Each instance has its own set, and so does each [`withRef()`](https://content.comark.dev/reference/content/with-ref) sibling.

A schema field whose type is missing from the set is handled by no plugin. The field keeps its stored value and is typed from its JSON Schema type. [Type generation](https://content.comark.dev/guide/typescript) logs a warning for each missing field type:

```txt
"docs" declares `x-content` fields of type "markdown" (body), but no installed plugin registered that field type — they are typed from their JSON Schema type.
```

## Usage

```ts [field-types.ts]
import { comarkContent } from 'comark-content'
import fs from 'comark-content/sources/fs'
import markdownFields from 'comark-content/plugins/markdown-fields'

const content = comarkContent({
  source: fs('./content'),
  plugins: [markdownFields()],
})

content.fieldTypes.has('markdown')  // true
content.fieldTypes.has('reference') // false, the references plugin is not installed
```


## Sitemap

See the full [sitemap](https://content.comark.dev/sitemap.md) for all pages.
