FieldsAll fields

All fields

Every field builder on f, what editors see for each, and the chain of modifiers they share. The pages that follow take them a few at a time.

View as Markdown

The builders

FieldEditor seesValue in the view
f.text()A single-line text box.string
f.richtext({ toolset })A text editor with the toolset's formatting and elements.A document for <RichText>
f.link()A text box for a URL or a site path.string
f.slug()A text box with the URL prefix in front. Name the field slug.string
f.number()A number box.number
f.date()A calendar. Stored as 2026-09-02.string
f.datetime()A calendar with a time, in the site's zone. Stored as a UTC instant.string
f.boolean()A switch.boolean
f.select([…])A dropdown.One of the option values
f.radio([…])A row of pills.One of the option values
f.checkboxes([…])A checkbox list.An array of option values
f.tags()Chips, with suggestions from existing entries.string[]
f.image({ aspect })The media picker, with a crop tool.A resolved image for the image component
f.video()The media picker.A resolved video for the video component
f.file()The media picker.A resolved file: url, filename, size, mime
f.object({ … })A group of fields.An object
f.list(item)A repeater: add, reorder, remove.An array of the item's value
f.ref(() => coll)A search picker over one collection.The entry's fields, or null
f.refList(() => coll)The same picker, taking several.An array of entries

Every field is required unless it chains .optional(). A boolean is never required, and an object whose fields are all optional may be left empty. Publish reports what is missing; drafts save regardless.

The chain

Every builder shares these modifiers. Chaining never changes the builder in place, so a shared builder is safe to reuse.

.optional()The field may be empty. Its type in the view gains undefined.
.default(value)The value a new section or entry starts with, and what the form shows while the field is empty.
.min(n), .max(n)Counts items on a list, a reference list and tags. .max(n) also limits a text's length in characters.
.localized()The field has its own value per language on an entry or a global. Page content is per language already.
.hidden(f.when(path).is(value))Leaves the form while the condition holds. See Conditional fields.
.resolve()On a ref: how far to follow the target's own references. See Reference and tags.

Where a field may go

The same builders serve every schema, with a few limits that keep the admin simple:

PlaceLimits
Section and element fieldsAny builder. A ref lives at the top level, never inside a list or an object. A list never holds a list.
SettingsAny builder, but never .localized(): a layout choice is the same in every language.
Page fieldsNo ref, list or richtext, and no .localized(), because page fields are per language already.
Collection fieldsAny builder. Name a text field slug to give entries their own URL part.
Elements in richtextAny builder except a ref.

Next, Text, number and date.

Edit this page on GitHubLast updated 6 Oct 2026