2: Schemas and fields

A create form rendered straight from the schema

A model declares its shape with a schema: a map of column name to a field(...) of a given type. The CMS reads the schema to build inputs, list columns, validation and the API.

static schema => arr (
	id:      field (type: 'number',   title: 'ID', list: false, record: false),
	title:   field (type: 'text',     title: 'Title', length: 160, required: true),
	body:    field (type: 'wysiwyg',  title: 'Body', list: false),
	created: field (type: 'datetime', title: 'Published'),
)

2.1: Field types

TypeStores / renders
texta string (set multiline: true for a textarea)
email, password, number, date, datetimetyped inputs
boola checkbox
select, multiselecta fixed option list
wysiwygrich text
tokena generated id
image, filean upload (see the Uploads chapter)
parent, child, manyrelations (see the Relations chapter)
virtuala computed, non-stored value

2.2: Common field options

The id field is conventionally hidden from both list and record, since the database assigns it.

2.3: The field() helper

field(type: 'x', ...) is shorthand: it resolves to the field_x resource with your arguments. Loading a field type is just listing fields/x in your resources, so an app only ships the field types it actually uses.

Last updated on 3 July 2026

We use essential cookies to make this site work. With your permission we also use analytics to improve the site.