Skip to content
Strife Docs

Reference

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, which documents the same editors from Strife Studio's UI. Use this section when you're writing a Schema 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:

OptionTypeDescription
description
string
Stored on the template. Studio's editor panel doesn't show it, except on a file field, as hover text on the field's name.
searchable
boolean
Stored on the template. Neither Studio nor the content index uses it today, and Strife has no search index for your site.
filterable
boolean
Stored on the template. Neither Studio nor the content index uses it today.
protected
boolean
Stops the field from being edited or removed in Studio's template designer. No effect in the editor panel.
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/UI-only and skip most of it, and serp skips searchable/filterable. 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 or in Strife Studio's template designer. 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 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 valueRead 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, 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, or as the first stored value when the default locale has none. The per-locale values stay stored, so turning the flag back on before anyone edits the field brings them back.

All builders

BuilderOutput typeLocalizable
string
Yes
string
Yes
number
Yes
boolean
No
boolean
No
string (ISO-8601)
Yes
string
Yes
string (HTML)
Yes
unknown
No
number
No
FileValue
No
Video
No
Image
Yes
ImageGroup
No
unknown[]
Yes
unknown
No
CollectionDefinition
No
string[] / number[] / Link[]
No
{value, name}[]
No
value[]
No
string[] / number[]
No
Record<string, unknown>[]
No
Asset[]
No
literal union
No
Link
Yes
Serp
Yes
fields.reference() (deprecated)
Target[] (read)
No
Target[] (read)
No
never (no data)
No
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.