Field types
Every field type the schema can declare, with its knobs, defaults, and the YAML it produces on disk.
The CMS supports 16 field types. Every field has the same set of common
keys (FieldBase) plus type-specific extras. This page is exhaustive —
use the table of contents on the right to jump to the type you need.
Common to every field
- key: heading # frontmatter key — where the value lands
type: text # discriminator — selects the field implementation
label: Heading # author-facing label, shown above the input
description: … # optional helper text, shown under the field
required: true # validator enforces non-empty
hidden: true # never rendered (value seeded from `default`)
default: 'Welcome' # initial value for new entries
visibleIf: # show only when the condition is true
field: tier
op: eq
value: pro
whenHidden: keep # keep | drop — what to do with stored value
customValidators: [] # plugin validators, see Validation
translatable: false # keep this field's text as it is in every language
role: seoTitle # what the field means to the site, see Field roles
computed: # auto-derived value, see Computed fields
from: title
transform: slug
mode: auto| Key | Effect |
|---|---|
key | The frontmatter key the value lands at. Must be unique inside its group. |
type | Type discriminator. The remaining knobs are type-specific. |
label | Author-facing label. Required on every field (no fallback to key). |
description | Helper text rendered under the input. |
required | Reject save when empty. See Validation → required. |
hidden | Never rendered. Value still seeded from default so saves don't strip it. |
default | Initial value (literals only; no expressions). |
visibleIf | Hide unless the condition evaluates true. See Conditional rendering. |
whenHidden | keep (default) preserves the stored value when hidden; drop purges on save. |
customValidators | Plugin validators applied in addition to the built-ins. |
computed | Auto-fill the value from another field. See Computed fields. |
translatable | Whether the field's text is translated when a page gets a language version. See below. |
role | What the field means to the site: seoTitle, seoDescription, shareImage, noindex, canonical, draft, alt or none. See Field roles. |
translatable belongs to language versions.
Left out, the default follows the type: text, paragraph and
richtext fields are translated; every other type is carried over as it
is. Not translated either: the field that links the versions, computed
and hidden fields, a text field with a regex (an id, an icon
name), and a slug (the new page gets its own). Set
translatable: false on text that must stay the same in every language
(a product code, a brand name), or true on a text field that would not
be translated by default. On a group or a list, false covers every
field inside that does not say translatable itself, and so does
hidden; true there only undoes a false further out, and the rules
above still apply to the fields inside. It is read when a page is
translated.
text
Single-line text input.
- key: title
type: text
label: Title
default: ''
minLength: 5
maxLength: 80
recommendedLength: { from: 30, to: 60 }
regex: '^[A-Z]'
regexMessage: 'Start with a capital.'
minLengthMessage: 'Make it at least 5 characters.'| Knob | Effect |
|---|---|
minLength | Hard lower bound (chars). Violations surface in the Health panel. |
maxLength | Hard upper bound. |
recommendedLength | Soft sweet-spot range. The counter turns green inside, amber outside. |
regex | JavaScript-flavoured regex source (no surrounding slashes). |
regexMessage | Custom error text for regex. |
*Message variants | Override the default error text for required / minLength / maxLength. |
variables | false hides the {{variable}} paster + hints on this field (also available on paragraph and link). |
Use text for short single-line values (titles, slugs, IDs). For multi-line
plain text use paragraph. For rich formatting use richtext.
paragraph
Multi-line plain-text input. Same length / regex knobs as text.
- key: description
type: paragraph
label: Description
rows: 3
recommendedLength: { from: 50, to: 160 }| Knob | Effect |
|---|---|
rows | Initial visible row count (auto-grows). |
Use paragraph for SEO descriptions, summaries, social-card copy — anywhere
the content is plain text but multi-line.
richtext
Tiptap-based rich-text editor. Every toolbar button is opt-in through
options: a flag that is absent or false removes the button and its
keyboard shortcut, so an author cannot sneak italics into a field that
only allows bold.
- key: body
type: richtext
label: Body
format: markdown
options:
bold: true
italic: true
link: true
headings: [2, 3]
bulletList: true
orderedList: true
blockquote: true| Knob | Values | Effect |
|---|---|---|
format | markdown (default), html | Storage format the value round-trips through. |
options | map of flags | bold, italic, strike, code, link, bulletList, orderedList, blockquote, codeBlock, horizontalRule (booleans), headings (allowed levels, e.g. [2, 3]), singleLine (one line, Enter suppressed), placeholder. Omit for the full toolbar. |
format: markdown writes the value as Markdown — typically the .md file's
body. format: html writes HTML. Pick markdown when your build pipeline
already runs the file through a Markdown processor; pick html when you
want the CMS to do the rendering and you're storing pre-rendered output.
number
Numeric input. Integer when step: 1, decimals otherwise.
- key: seats
type: number
label: Seats
min: 1
max: 100
step: 1
default: 1| Knob | Effect |
|---|---|
min | Reject save when below. |
max | Reject save when above. |
step | Increment (also drives integer vs decimal). |
For a sliding-control UI prefer range. For a set of allowed values use select.
boolean
Toggle. The simplest field type.
- key: featured
type: boolean
label: Featured
default: falseNo type-specific knobs beyond default.
date
Date picker. Stores as ISO-8601 yyyy-mm-dd.
- key: publishedAt
type: date
label: Published at
default: ''No time component. Use a text field with a regex if you need ISO datetimes
or other formats.
color
Colour picker.
- key: accent
type: color
label: Accent colour
format: hex
default: '#3b33c7'| Knob | Values | Effect |
|---|---|---|
format | hex (default), oklch | hex writes #rrggbb and renders the native colour picker; oklch writes oklch(...) — useful when your theme runs through Tailwind v4 / OKLch — but renders a plain text input for now (no picker). |
range
Slider with min / max / step.
- key: spacing
type: range
label: Spacing
min: 0
max: 100
step: 5
default: 50Same min / max / step semantics as number but renders as a slider control.
Good fit for opacity, spacing scale, or any value the author tweaks visually.
multichoice
Multi-select with min / max constraints. Value is string[].
- key: tags
type: multichoice
label: Tags
options:
- travel
- food
- sport
min: 1
max: 3| Knob | Effect |
|---|---|
options | The allowed values. Strings or {value, label, description} objects. |
min | Reject save when fewer than this many are selected. |
max | Reject save when more than this many are selected. |
Multichoice arrays diff as + added, − removed pills in the
Version history — the schema-aware renderer
recognises the set semantics.
link
A hyperlink. The file holds one plain string, the editor shows a type selector on the left so authors never type an address by hand:
| Kind | What the author sees | What is stored |
|---|---|---|
| Page | A picker over the site's pages; the chosen page's title and address. | /sluzby/ |
| URL | A text input for an outside address. | https://example.org/ |
| An address input. | mailto:[email protected] | |
| Phone | A number input. | tel:+420123456789 |
| File | The media picker. | /files/brochure.pdf |
| Anchor | A section id. | #pricing |
The kind is read off the stored value when a page opens and is never written to the file, so content written before this editor and every site build keep working unchanged.
- key: ctaHref
type: link
label: Button link
regex: '^https?://' # optional: force an outside addressPage links are watched by the content index: when the target page is renamed through the CMS the links are updated with it, and a link to a page that disappeared is flagged in the editor. See Links and references.
| Key | Type | Effect |
|---|---|---|
default | string | Initial value. |
regex | string | Validation pattern, same semantics as text. |
variables | boolean | Show the {{variable}} paster on the URL kind. Defaults to true. |
reference
A pointer at another entry of this site, for templates that resolve the target themselves at build time. Stores a plain string: the target's content file path, or the value of one of its fields.
- key: page
type: reference
label: Page
collection: pages # which entries the picker offers (optional)
by: field:translationKey # or `path` (the default)
multiple: false # true stores a list| Key | Type | Effect |
|---|---|---|
collection | string | Only entries of this collection can be picked and matched. Any collection when absent. |
by | string | path stores src/content/pages/cs/kontakt.md; field:<key> stores that field's value of the target, such as a translationKey. |
multiple | boolean | Store an array of references instead of one. |
Use by: field:<key> when the site already resolves a key to a URL,
the way the navigation in the Astro template links the language
versions of a page by translationKey. Such a reference survives slug
changes and file moves without any rewrite. Use by: path when the
build loads the referenced entry directly (Astro's getEntry). The
content index reports a reference whose target no longer exists as
broken.
image
Picker + drag-drop upload. With storage: set, the picker scopes to that
storage and the upload routes through it.
- key: hero
type: image
label: Hero image
storage: uploads
accept: image/png, image/jpeg
maxSize: 5242880
alt: hero_alt # the field next to it that holds the alt text
- key: hero_alt
type: text
label: Hero image description| Knob | Effect |
|---|---|
storage | Named storage from config.yml#storages. See Media library. |
accept | Comma-separated MIME glob list. Overrides the storage's accept. |
maxSize | Bytes. Overrides the storage's max_size. |
alt | Key of the text or paragraph field (or localized group of them) in the same fields list that holds the image's alt text, or { from: [title, technique], separator: ' – ' } to compose it from several. See Field roles. |
decorative | true when the image needs no alt text (a background, an ornament). Not combined with alt. |
The editor renders the value as an inline thumbnail. For non-images use file.
file
Same as image but for non-image attachments (PDFs, videos, audio).
- key: attachment
type: file
label: Attachment
storage: uploads
accept: application/pdf
maxSize: 10485760The editor renders the value as a file row (name + icon + type + size) rather than a thumbnail.
select
Single-select with an explicit option list.
- key: tier
type: select
label: Tier
options:
- free
- pro
- enterprise
default: free
widget: dropdown| Knob | Values | Effect |
|---|---|---|
options | array of strings or {value, label, description, labels} | The allowed values. |
default | one of the option values | Initial value. |
widget | dropdown (default), radio, buttons, combobox | Controls the input UI. |
An option's labels holds its label per site language, for a site
that shows the option on the page in each language (a
title template
with {field:kind|label} reads it). The editor shows label.
options:
- value: painting
label: Malba
labels: { cs: Malba, en: Painting, it: Pittura }A select can hold the noindex or draft role with noindexWhen or
draftWhen, the values that switch it on (see
Field roles).
dropdown is the universal default. radio for short lists where every option
should be visible. buttons for visual toggles. combobox for long lists
where the author needs to type-to-search.
group
Object field — a nested set of fields under a single key.
- key: hero
type: group
label: Hero
fields:
- key: heading
type: text
label: Heading
- key: subheading
type: paragraph
label: Subheading
preview:
title: heading| Knob | Effect |
|---|---|
fields | Ordered list of child fields. Recursive — groups can contain groups. |
preview | Drives the "drill-in card" rendering when the parent surfaces this group. |
inline | true renders the child fields in place (bordered container) even where the group would otherwise be a drill-in card — right for small groups an author fills together, like per-language translations or a CTA's label + link. |
The value is {heading, subheading} in YAML; the editor renders the inner
fields inline at the parent level. A group mounted inside an array item
renders as a drill-in card instead — unless it declares inline: true.
A group of languages
On a site that keeps every language of a page in one file, a text is a
group with one field per language. localized: true says so, and
fallback: names the language an empty one shows on the site:
- key: title
type: group
label: Title
localized: true
fallback: cs
fields:
- { key: cs, type: text, label: Czech }
- { key: en, type: text, label: English }
- { key: it, type: text, label: Italian }| Knob | Effect |
|---|---|
localized | true when the group's fields are the site's languages: one per language of preview.locales, keyed by it, and nothing else. |
fallback | The language whose text an empty language shows on the site, as your site's code does it. Only with localized: true. |
The rules, and which collections may hold such a group, are under Languages in one file.
array
The richest field type. Each items[] entry is one allowed item shape — a
group, a $ref to a block, or a primitive ({type: text} for arrays of
strings).
- key: blocks
type: array
label: Content blocks
items:
- $ref: hero-compact
- $ref: media-text
idKey: _type
minItems: 1
maxItems: 10
uniqueOn: slug
uniqueOnMessage: 'Each block needs a unique slug.'| Knob | Effect |
|---|---|
items | One entry per allowed item shape. Single-entry = uniform array; multi-entry = multi-shape. |
idKey | Multi-shape discriminator key on items. Defaults to _type. Override for content that uses kind:, block:, etc. |
minItems | Reject save when below this count. |
maxItems | Reject save when above this count; "Add item" disables at the cap. |
uniqueOn | Relative path within an item; rejects duplicates. |
*Message | Custom messages for any of the above. |
Single-shape
items:
- type: text
key: tag
label: TagEvery item is the same shape. No discriminator key on items.
Multi-shape
items:
- $ref: hero-compact
- $ref: media-text
- $ref: stats-rowEach item carries a discriminator key (_type: by default) matching one
entry's $ref target. The CMS reads + writes through this key. Changing
idKey: after content exists requires a one-shot migration to rename the
key on each item.
Primitive
items:
- type: text
key: tagArrays of strings, numbers, etc. No discriminator needed (the JS type is the discriminator). The editor renders a compact list with inline controls.