Field types
The types available when adding a field to a block or content type.
| Type | Editor sees | Value your component gets |
|---|---|---|
text | A single-line box | string |
lines | A multi-line box | string with newlines |
richtext | A formatting editor | HTML string |
number | A number box | number |
boolean | A switch | boolean |
date | A date picker | ISO date string |
color | A colour picker | CSS colour string |
select | A dropdown of your options | one of the option strings |
image | A media picker | { url, alt, width, height } |
link | A link picker | resolved link object |
list | Repeatable rows | Array<object> |
group | A nested set of fields | object |
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 | centerBetter 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:
{ "url": "https://cms.nubisco.io/media/…", "alt": "…", "width": 1600, "height": 900 }Render width and height to stop the page jumping as images load.
link
The editor picks a document, an external URL, or a media file. Your component gets it resolved:
{ "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: linkYour 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: linkUse 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:
| Modifier | Effect |
|---|---|
required | Publishing is refused while it is empty. |
localized | A separate value per language. |
help | A sentence shown under the field. |
default | The value a new block starts with. |