> From the [Strife developer docs](https://strife.app/docs/reference/field-reference). Every page is listed in [llms.txt](https://strife.app/docs/llms.txt).

# Field Reference

Every fields.* builder from @strifeapp/schema, with its full option set, output type, and wire-format mapping — the code-first counterpart to the Studio-UI Fields reference.

This section documents every `fields.*` builder exported by `@strifeapp/schema` — the code-first counterpart to [Fields](https://strife.app/docs/reference/fields.md), which documents the same editors from Strife Studio's UI. Use this section when you're writing a [Schema](https://strife.app/docs/reference/cli/schemas.md) and want the complete option set for a specific builder; use the Studio Fields reference when you're looking at a template built by hand in Strife Studio and want to know what an editor does.

Each page follows the same shape: a minimal example, the full options table (sourced directly from the builder's TypeScript signature), the inferred output type, and any notes worth knowing — including a few places where the code-first builder's options don't (yet) cover everything the underlying Strife Studio editor supports.

## Common options

Every builder takes `label` (required) and, unless noted on its own page, most also accept:

| Option         | Type      | Description                                                                            |
| -------------- | --------- | -------------------------------------------------------------------------------------- |
| `description`  | `string`  | Stored on the template. Studio shows it on chapters, references, repeatable, assets and data table fields, as a note while the field is empty.                                   |
| `propertyName` | `string`  | Override the stored property name. Defaults to the field's key in the `fields` object. |
| `localizable`  | `boolean` | Only present on builders where a per-locale value makes sense — see the table below.   |

A few builders are exceptions to this common set: `hint` and `tabs` are structural and skip most of it. Each page's own table is the source of truth; don't assume every option on this page applies everywhere.

`localizable` is available on exactly these ten builders: `text`, `paragraph`, `number`, `date`, `slug`, `html`, `image`, `link`, `serp`, and `chapters`. Every other builder either doesn't expose it (a boolean or a selected option isn't the kind of value that varies by locale) or is structural (`hint`, `tabs`).

## Turning `localizable` on for a field with content

You can turn `localizable` on for a field that already holds content, with `strife push`. The content is kept. Changing the flag rewrites no documents: it creates no drafts, no unpublished changes and no versions.

A value stored before the flag was turned on is a **shared value**. It is the value of every locale of the document, on your site and in Studio, until someone gives one locale its own value:

* **Editing one locale splits the value.** That locale gets the new value, and every other locale the document has keeps a copy of the old one. This holds for every way of editing: Studio, the [MCP server](https://strife.app/docs/tools/mcp-server.md) and the API.
* **Publishing some locales** publishes their new values. The other locales keep the old shared value on the site.
* **Discarding a locale** whose published value is still shared gives that locale the shared value back.
* **AI translation** (creating a language version, or translating changed fields) uses a shared text value as the source text. Only the target locale gets the translation. The other locales keep the shared value.

### Which stored values already have a value per locale

For a localizable field, Strife reads the stored value like this:

| Stored value | Read as |
| --- | --- |
| An object whose keys all look like locale codes (`en`, `sv`, `pt-BR`), and at least one of them is a locale the team has configured, such as `{ "en": "Hello", "sv": "Hej" }` | One value per locale |
| `null`, or an empty object `{}` | No value on any locale |
| Anything else | A shared value |

"Anything else" includes strings, numbers, arrays, chapters, a reference such as `{ "id": "pages/1" }`, and an object with a key that isn't a locale code, such as `{ "id": "…", "alt": "…" }`. It also includes an object whose keys look like locale codes when none of them is configured. An image group with media named `og`, or `sm`, `md` and `lg`, is a shared value and shows on every locale. So is a leftover `{ "de": "Hallo" }` after `de` was removed from the team. An object such as `{ "sv": "Hej", "de": "Hallo" }` still has one value per locale after `de` is removed, because `sv` is configured.

### Update the content index first

Your site reads shared values correctly only from a content index built from `@strifeapp/strife` 1.24.0 or later. Upgrade the package and run [`strife push`](https://strife.app/docs/reference/cli/commands.md#strife-push), which redeploys `Content/ByUrl`. An older index shows a shared text or number on the team's default locale only, and a shared object, array or chapters list on no locale at all. Studio shows the shared value on every locale either way.

Until every content index on the team is updated, Studio warns when a field is turned localizable: it shows "Template saved with a warning" after the save, and the warning names the fields and the content indexes that need updating. The change is saved either way.

> [!NOTE]
> **Your own content index.** Strife checks every content index on the team: every JavaScript index whose map calls `mapDocument`. It counts an index as updated when its source contains a function named `classifyLocalizedValue`. Strife only looks for the name. If you build your index from the `@strifeapp/strife/content-index` source, take that source from version 1.24.0 or later. If you write the function yourself, it must follow the table above. For a localizable field, a locale object gives each locale its own value, `null` and `{}` give no value, and anything else gives the stored value itself on every locale.

### Turning `localizable` off

Turning `localizable` off deletes nothing either. A field that still holds a value per locale reads as the default locale's value. When the default locale has no value, it reads as the first stored value, or, in the content index of `@strifeapp/strife` 2.0.1 and later, as the first of the team's languages that has one. The per-locale values stay stored, so turning the flag back on before anyone edits the field brings them back.

## All builders

| Builder                                                 | Output type                        | Localizable |
| ------------------------------------------------------- | ---------------------------------- | ----------- |
| [`fields.text()`](https://strife.app/docs/reference/field-reference/fields.text.md)                       | `string`                           | Yes         |
| [`fields.paragraph()`](https://strife.app/docs/reference/field-reference/fields.paragraph.md)             | `string`                           | Yes         |
| [`fields.number()`](https://strife.app/docs/reference/field-reference/fields.number.md)                   | `number`                           | Yes         |
| [`fields.switch()`](https://strife.app/docs/reference/field-reference/fields.switch.md)                   | `boolean`                          | No          |
| [`fields.toggle()`](https://strife.app/docs/reference/field-reference/fields.toggle.md)                   | `boolean`                          | No          |
| [`fields.date()`](https://strife.app/docs/reference/field-reference/fields.date.md)                       | `string` (ISO-8601)                | Yes         |
| [`fields.slug()`](https://strife.app/docs/reference/field-reference/fields.slug.md)                       | `string`                           | Yes         |
| [`fields.html()`](https://strife.app/docs/reference/field-reference/fields.html.md)                       | `string` (HTML)                    | Yes         |
| [`fields.slider()`](https://strife.app/docs/reference/field-reference/fields.slider.md)                   | `number`                           | No          |
| [`fields.video()`](https://strife.app/docs/reference/field-reference/fields.video.md)                     | `Video`                            | No          |
| [`fields.image()`](https://strife.app/docs/reference/field-reference/fields.image.md)                     | `Image`                            | Yes         |
| [`fields.imageGroup()`](https://strife.app/docs/reference/field-reference/fields.imagegroup.md)           | `ImageGroup`                       | No          |
| [`fields.chapters()`](https://strife.app/docs/reference/field-reference/fields.chapters.md)               | `unknown[]`                        | Yes         |
| [`fields.contentTemplate()`](https://strife.app/docs/reference/field-reference/fields.contenttemplate.md) | `unknown`                          | No          |
| [`fields.collection()`](https://strife.app/docs/reference/field-reference/fields.collection.md) ⚠         | `CollectionDefinition`             | No          |
| [`fields.repeatable()`](https://strife.app/docs/reference/field-reference/fields.repeatable.md)           | `string[]` / `number[]` / `Link[]` | No          |
| [`fields.select()`](https://strife.app/docs/reference/field-reference/fields.select.md)                   | `{value, name}[]`                  | No          |
| [`fields.multiSelect()`](https://strife.app/docs/reference/field-reference/fields.multiselect.md)         | `value[]`                          | No          |
| [`fields.multiInput()`](https://strife.app/docs/reference/field-reference/fields.multiinput.md)           | `string[]` / `number[]`            | No          |
| [`fields.tableInput()`](https://strife.app/docs/reference/field-reference/fields.tableinput.md)           | `Record<string, unknown>[]`        | No          |
| [`fields.assets()`](https://strife.app/docs/reference/field-reference/fields.assets.md)                   | `Asset[]`                          | No          |
| [`fields.radioGroup()`](https://strife.app/docs/reference/field-reference/fields.radiogroup.md)           | literal union                      | No          |
| [`fields.link()`](https://strife.app/docs/reference/field-reference/fields.link.md)                       | `Link`                             | Yes         |
| [`fields.serp()`](https://strife.app/docs/reference/field-reference/fields.serp.md)                       | `Serp`                             | Yes         |
| [`fields.reference()`](https://strife.app/docs/reference/field-reference/fields.reference.md) (deprecated) | `Target[]` (read)                 | No          |
| [`fields.references()`](https://strife.app/docs/reference/field-reference/fields.references.md)           | `Target[]` (read)                  | No          |
| [`fields.hint()`](https://strife.app/docs/reference/field-reference/fields.hint.md)                       | `never` (no data)                  | No          |
| [`fields.tabs()`](https://strife.app/docs/reference/field-reference/fields.tabs.md)                       | `never` (structural)               | No          |

> [!NOTE]
> This reference is generated from `@strifeapp/schema`'s TypeScript source, so it only documents options the DSL actually implements today. A few Studio-UI editor capabilities noted on the pages above (⚠, and a couple more called out on individual pages) aren't reachable from `defineType`/`fields.*` yet — the per-field pages call these out explicitly rather than implying parity that doesn't exist.
