Skip to content

Field types

The types available when adding a field to a block or content type.

TypeEditor seesValue your component gets
textA single-line boxstring
linesA multi-line boxstring with newlines
richtextA formatting editorHTML string
numberA number boxnumber
booleanA switchboolean
dateA date pickerISO date string
colorA colour pickerCSS colour string
selectA dropdown of your optionsone of the option strings
imageA media picker{ url, alt, width, height }
linkA link pickerresolved link object
listRepeatable rowsArray<object>
groupA nested set of fieldsobject

text and lines

text for one line: a heading, a label, a name.

lines for several: an address, a short list of plain items. It preserves line breaks, so render with white-space: pre-line.

richtext

For body copy that needs bold, links and lists. It produces HTML.

Do not use it for headings. A heading that can contain a bulleted list is a heading that eventually will.

select

Declare the allowed options. Use it for anything your component switches on:

variant: primary | secondary | ghost
align:   left | center

Better than text for the same purpose, because the editor cannot type centre and quietly break the layout.

image

Gives your component the URL, alt text and intrinsic dimensions:

json
{ "url": "https://cms.nubisco.io/media/…", "alt": "…", "width": 1600, "height": 900 }

Render width and height to stop the page jumping as images load.

The editor picks a document, an external URL, or a media file. Your component gets it resolved:

json
{ "kind": "doc", "route": "/products/x", "href": "/products/x", "status": "ok" }

status is ok, missing or unpublished.

Always use link rather than text for a destination. A link field is checked before publishing; a text field holding a URL is not, and it rots the first time a page moves.

list

Repeatable content. Declare the fields of one item:

tiles: list
  ├ name:    text
  ├ tagline: text
  └ href:    link

Your component gets an array of those objects. Default to [], and never index by a fixed position — editors reorder things.

group

A single nested object, for a set of fields that belong together:

cta: group
  ├ title: text
  ├ body:  text
  └ href:  link

Use a group when the set is optional as a whole. Guarding v-if="fields.cta" is clearer than checking three separate fields.

Modifiers

Available on any type:

ModifierEffect
requiredPublishing is refused while it is empty.
localizedA separate value per language.
helpA sentence shown under the field.
defaultThe value a new block starts with.

A Nubisco product. Not open source.