Search pages, headings and code across the docs, examples and tutorials.

to navigateto open
Database

Field types

Every field type ohne ships, with all of its options.

Every field has a type, named by the first argument of field(). The second argument holds that type's options:

collections/Posts.ts
import { defineCollection, field } from 'ohnejs';

export default defineCollection({
  fields: {
    title: field('text', { max: 120 }),
    status: field('select', { choices: ['draft', 'published'] }),
  },
});

This page lists every type ohne ships, with all the options each one takes. Collections and fields shows how the types work together, and custom field types shows how to add your own.

Types and options are sorted alphabetically. The default is what an omitted option resolves to. A - means the option stays unset, and "required" means the field() call does not type-check without it.

Built-in types

These are part of the framework, so every app has them.

blocks

The blocks field in the dashboard

An ordered list of mixed, reusable shapes, each defined once under blocks/. Blocks covers them in depth.

OptionDefaultWhat it does
allow-The block types the field may hold. Omitted, it accepts every block the app defines.
allowEmptytrueAccepts an empty list. With false, a written [] is rejected, so the field needs at least one block.
default[]A function that returns the list a create stores when its input leaves the field out.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtruefalse keeps search from looking inside the blocks.
translatablefalseKeeps one list per locale. Top-level collection fields only.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

boolean

The boolean field in the dashboard

true or false.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
display'checkbox'The editor: 'checkbox', 'switch', or 'buttons'. The stored value is the same either way.
falseLabel-The false button's label under display: 'buttons', as a string or a message key. Omitted, it reads "No".
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalseA boolean has nothing for search to match, so true fails at boot.
translatablefalseKeeps one value per locale. Top-level collection fields only.
trueLabel-The true button's label under display: 'buttons', as a string or a message key. Omitted, it reads "Yes".
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

code

The code field in the dashboard

Source code, edited with line numbers and highlighting. Tab indents, and Escape leaves the editor.

OptionDefaultWhat it does
allowEmptyfalseAccepts the empty string ''.
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indent2What Tab inserts: that many spaces, or 'tab'.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
language-The language to highlight: ts, json, css, html, markdown, sql, yaml, xml, sh or gitignore, or a file name like config.json. json also rejects a value that does not parse.
languageFrom-A sibling field whose value names the language, or a file path like app.json.
max-The most characters a value may hold, counted like String#length, so an emoji counts as 2.
min-The fewest characters a value may hold, counted the same way.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search match any value that contains the typed word.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
wrapfalseWraps long lines instead of scrolling sideways.
writabletruefalse removes the field from write inputs, so its value comes from default.

color

The color field in the dashboard

A hex color, stored in one form, so #F80 is stored as #ff8800. A translucent color needs alpha and is stored as #rrggbbaa.

OptionDefaultWhat it does
alphafalseAllows a translucent color, stored with its alpha as #rrggbbaa.
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search match any value that contains the typed word.
swatches-Colors the dashboard offers to pick from, in any hex spelling. Any other color stays legal.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

date

The date field in the dashboard

A calendar day, stored as YYYY-MM-DD text. No time zone is involved.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The latest day, as YYYY-MM-DD.
min-The earliest day, as YYYY-MM-DD.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtrueLets search match the field. A year, month, or day like 2024-06 finds the days it starts.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

dateTime

The dateTime field in the dashboard

An instant, stored as epoch milliseconds. A write takes that number only, so convert a Date with getTime() first. The dashboard shows it in the viewer's time zone.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The latest instant, as epoch milliseconds or an ISO 8601 string.
min-The earliest instant, as epoch milliseconds or an ISO 8601 string.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
relativeTimefalseShows the instant as elapsed time, like "2 hours ago", with the exact date on hover.
sanitizers-Functions that clean the value before it is validated.
searchfalseAn instant has nothing for search to match, so true fails at boot.
timezone-A fixed IANA zone the dashboard shows and edits the instant in. Omitted, the viewer's own zone applies.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

duration

The duration field in the dashboard

A length of time, stored as whole milliseconds, which writes, reads, and where use. The dashboard takes text like 1h 30m and shows the value in the reader's language. Its units are ms, s, m, h, d, w, mo (30 days) and y (365 days).

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The longest duration, as milliseconds or text like '2h'.
min0The shortest duration, as milliseconds or text like '5m'.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search find the exact duration, like 90m.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

email

The email field in the dashboard

An email address, stored trimmed and lowercased, so Thrall@Orgrimmar.example and thrall@orgrimmar.example are one value for unique. A where compares its value as you pass it, so normalize it first with normalizeEmail from ohnejs/utils.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtrueLets search match any value that contains the typed word.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

integer

The integer field in the dashboard

A whole number within JavaScript's safe range. With a currency it is an amount in minor units, so 1999 in EUR is 19.99 €.

OptionDefaultWhat it does
currency-The ISO 4217 currency the value counts in, like 'EUR'. min, max and step count minor units too.
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
display'input'The editor: 'input', or 'slider' for an input beside a range track. A slider needs min and max. The stored value is the same either way.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The largest value.
min-The smallest value.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search find the exact number, like 1042.
step-The grid every value must lie on: min plus a multiple of step, or a multiple of step without min.
suffix-A unit shown after the value, like 'kg', as a string or a message key.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

json

The json field in the dashboard

Any plain JSON value, stored as JSON. Its value has the type unknown. For a checked shape, write a custom type. A top-level null needs nullable. A write rejects what JSON would drop or distort, like NaN, a Date, or a key set to undefined.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster null lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
maxDepth32How deeply arrays and objects may nest. A scalar is depth 0.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalseLocked: search never matches a JSON value, and true fails at boot.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseLocked: one value can be stored with its keys in another order, so true fails at boot.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.
The link field in the dashboard

One link to an address or to a record, stored as JSON. Rich text covers its value and how a record link is checked.

OptionDefaultWhat it does
collections-The collections whose records the field may link to. Omitted, only addresses are allowed.
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalseLocked: search never matches a link, and true fails at boot.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

multiSelect

The multiSelect field in the dashboard

An ordered list of distinct strings, stored as a JSON list. Duplicates are removed on write.

OptionDefaultWhat it does
choices-The values each entry must come from, each value once. Each is a string, or { value, label }. Omitted, any strings are accepted.
default[]The list a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The most entries the list may hold.
min-The fewest entries the list may hold.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtrueLets search match the field: a word of a choice's value or label, or the exact entry without choices.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

number

The number field in the dashboard

A finite decimal, exactly like a JavaScript number. NaN and the infinities are rejected.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
display'input'The editor: 'input', or 'slider' for an input beside a range track. A slider needs min, max and step. The stored value is the same either way.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The largest value.
min-The smallest value.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search find the exact number, like 1.5.
step-The grid every value must lie on: min plus a multiple of step, or a multiple of step without min.
suffix-A unit shown after the value, like 'kg', as a string or a message key.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

object

The object field in the dashboard

One nested group of fields, stored in its own table. A record holds one group, or none when the field is nullable.

OptionDefaultWhat it does
default-A function that returns the group a create stores when its input leaves the field out.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
fieldsrequiredThe subfields, each a field(...).
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
layout-How the editor arranges the subfields. Omitted, they stack in order.
nullablefalseLets the record hold no group, read as null.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtruefalse keeps search from looking inside the object.
translatablefalseKeeps one group per locale. Top-level collection fields only.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

range

The range field in the dashboard

A start and an end of one kind, picked by of: two days, two instants, two times of day, or two numbers. A record reads it as { UUID, start, end }, each end stored as a field of its of type stores it. The start must not exceed the end, and ordering by the field sorts by its start.

OptionDefaultWhat it does
currency-An integer range only: the ISO 4217 currency both ends count in, like 'EUR'. min, max, step and the spans count minor units too.
default-A function that returns the range a create stores when its input leaves the field out.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
display'input'A numeric range only: 'slider' adds a two-thumb track above the inputs. A slider needs min and max, and each span must be a multiple of step.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The latest end, in the form the of type takes for its own max.
maxSpan-The longest end - start. A number for a numeric range, else milliseconds or text like '2 weeks'. Not with open.
min-The earliest start, in the form the of type takes for its own min.
minSpan-The shortest end - start. A number for a numeric range, else milliseconds or text like '1 day'. Whole days for a date range.
nullablefalseLets the record hold no range, read as null.
ofrequiredThe kind of both ends: date, dateTime, time, integer, or number.
openfalseLets the end stay null. Not for a time range.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtrueLets search match a date or time end. A numeric range needs search: true, as its of type does.
step-A numeric range only: the grid both ends lie on, as for an integer or number.
suffix-A numeric range only: a unit shown after the values, like 'kg', as a string or a message key.
timezone-A fixed IANA zone the dashboard shows and edits a dateTime range in. Omitted, the viewer's own zone applies.
translatablefalseKeeps one range per locale. Top-level collection fields only.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

record

The record field in the dashboard

A reference to one record of another collection, stored as its UUID. It is always nullable and always indexed, so no option makes it required.

OptionDefaultWhat it does
collectionrequiredThe collection the field references.
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
onDelete'setNull'What happens when the target is deleted: 'setNull' clears the reference, 'cascade' deletes this row, and 'restrict' blocks the delete.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtruefalse stops search from finding records through this link.
translatablefalseKeeps one reference per locale. Top-level collection fields only.
uniquefalseLets at most one row reference each target, for a one-to-one relation.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

records

The records field in the dashboard

An ordered list of references to records of another collection, stored in a junction table. A list that names the same UUID twice is rejected.

OptionDefaultWhat it does
allowEmptytrueAccepts an empty list. With false, a written [] is rejected, so the field needs at least one link.
collectionrequiredThe collection the field references.
default[]A function that returns the list a create stores when its input leaves the field out.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
inverse-The owning records field on the target collection. This field then shares its junction.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The most links a written list may hold.
min-The fewest links a written list may hold.
onDelete'cascade'What happens to a link when its target is deleted: 'cascade' removes the link, and 'restrict' blocks the delete. Not on an inverse field.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtruefalse stops search from finding records through these links. Off by default on an inverse field.
translatablefalseKeeps one list per locale. Top-level collection fields only, and not on an inverse field.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

repeater

The repeater field in the dashboard

An ordered list of nested groups of fields, stored in its own table. Every item keeps its own UUID.

OptionDefaultWhat it does
allowEmptytrueAccepts an empty list. With false, a written [] is rejected, so the field needs at least one item.
default[]A function that returns the list a create stores when its input leaves the field out.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
fieldsrequiredThe fields of one item, each a field(...).
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
layout-How the editor arranges the fields of an item. Omitted, they stack in order.
max-The most items a written list may hold.
min-The fewest items a written list may hold.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtruefalse keeps search from looking inside the items.
translatablefalseKeeps one list per locale. Top-level collection fields only.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

richText

The richText field in the dashboard

Formatted text with links, stored as a JSON tree. Rich text covers its value, links, rendering and editing.

OptionDefaultWhat it does
allowEmptyfalseAccepts the empty value [].
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
elements['h2', 'h3', 'ul', 'ol', 'blockquote']The block elements allowed besides paragraphs: h2 to h6, ul, ol and blockquote.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
inlinefalseHolds at most one paragraph, rendered without a <p>. elements does not apply.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
lineBreakstrueWith false, each \n becomes a space.
linkstruefalse allows no links, true allows addresses, and a list of collections also allows their records.
marks['strong', 'em', 'code']The marks allowed on text. del is strikethrough.
max-The most characters the run text may hold, counted like String#length.
min-The fewest characters the run text may hold, counted the same way.
nullablefalseLets the field hold null.
placeholder-The hint an empty editor shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalseLocked: search never matches rich text, and true fails at boot.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

select

The select field in the dashboard

One value out of a list you declare. The record type narrows to that union, and a value outside the list is rejected.

OptionDefaultWhat it does
choicesrequiredThe values the field accepts, at least one, each value once. Each is a string, or { value, label } with a label the dashboard shows.
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
display'dropdown'The editor: 'dropdown', or 'buttons' for a short list that reads at a glance. The stored value is the same either way.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtrueLets search match the field by a word of a choice's value or label, like pub for Published.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

slug

The slug field in the dashboard

The URL-safe name of a record, like about. A write stores lowercase Latin words joined by -, so Über uns stores as uber-uns. A where compares its value as you pass it, so canonicalize it first with canonicalSlug from ohnejs/utils.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
from-The field a new record's slug follows in the dashboard while you type, like 'title', as a field path.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nestedfalseKeeps / between segments, like docs/install. Without it, / folds into -.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtrueLets search find the canonical form of the typed word, so AC/DC finds ac-dc.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

text

The text field in the dashboard

A string. It rejects the empty string unless allowEmpty is set.

OptionDefaultWhat it does
allowEmptyfalseAccepts the empty string ''.
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The most characters a value may hold, counted like String#length, so an emoji counts as 2.
min-The fewest characters a value may hold, counted the same way.
multilinefalseEdits the value in a text area. The stored value is the same either way.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtrueLets search match any value that contains the typed word.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

time

The time field in the dashboard

A time of day, stored as HH:MM:SS text. HH:MM input is stored with :00 seconds.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The latest time, as HH:MM:SS or HH:MM.
min-The earliest time, as HH:MM:SS or HH:MM.
nullablefalseLets the field hold null.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtrueLets search match the field. A time like 10:30 finds the times that start with it.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

url

The url field in the dashboard

An absolute https:// or http:// address on a public domain, stored with its scheme and host lowercased and a default port dropped, along with a path that is only /. A where compares its value as you pass it, so normalize it first with normalizeHTTPURL from ohnejs/utils. For a mailto: or tel: address or a /path, use link.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtrueLets search match any value that contains the typed word.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

Base layer types

The ohnejs/base layer ships these types. Any collection can use them while your app stacks the layer.

country

The country field in the dashboard

An ISO 3166-1 country code, like DE, stored in upper case. The dashboard shows the country's name in the reader's language.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
only-The country codes the field admits, like ['DE', 'AT', 'CH']. Omitted, every country is admitted.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search find the exact code, or a word start of the country's name.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

currency

The currency field in the dashboard

An ISO 4217 code of a circulating currency, like EUR, stored in upper case. The dashboard shows the currency's name in the reader's language. To store an amount, use an integer with a currency instead.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
only-The currency codes the field admits, like ['EUR', 'USD']. Omitted, every circulating currency is admitted.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search find the exact code, or a word start of the currency's name.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

datePattern

The datePattern field in the dashboard

A date or time format pattern, like YYYY-MM-DD. It holds at most 64 characters and may not be blank.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search match any value that contains the typed word.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

language

The language field in the dashboard

A dashboard language, stored as its canonical BCP-47 tag, so de-at is stored as de-AT. Only a language that has a message catalog is accepted.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search match any value that contains the typed word.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

locale

The locale field in the dashboard

One of your content locales, stored as its canonical tag, so de-at is stored as de-AT.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search match any value that contains the typed word.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

password

The password field in the dashboard

Takes a plain-text password and stores its scrypt hash. Sanitizers and validators see the plain text, so a policy like a minimum length goes in a validator. The Users password already has one: auth.password.minLength. Pass readable: false, or reads return the hash.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalseLocked: search never matches a password, and true fails at boot.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

roles

The roles field in the dashboard

A list of role names, stored as a JSON list. Each entry must name a defined role, and duplicates are removed on write.

OptionDefaultWhat it does
default[]The list a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search find the holders of a role by its exact name.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

timezone

The timezone field in the dashboard

An IANA time zone name, like Europe/Berlin.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
indexfalseAdds an index on the column, for faster lookups.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
nullablefalseLets the field hold null.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchfalsetrue lets search match any value that contains the typed word.
translatablefalseKeeps one value per locale. Top-level collection fields only.
uniquefalseRejects a value that another row already holds.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

Uploads layer types

The uploads layer adds types that reference files in its Uploads collection, and the name types that collection stores its files under. Media fields covers how a write checks the references and how you read them.

file

The file field in the dashboard

A reference to one uploaded file, stored as its UUID. It is always nullable and always indexed, so no option makes it required.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
maxSize-The largest file accepted, in bytes or as a size like '5mb'.
minSize-The smallest file accepted, in bytes or as a size like '10kb'.
onDelete'setNull'What happens when the upload is deleted: 'setNull' clears the reference, 'cascade' deletes this row, and 'restrict' blocks the delete.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtruefalse stops search from finding records through this file.
translatablefalseKeeps one reference per locale. Top-level collection fields only.
types-The media types accepted, as exact types, wildcards, or categories. Omitted, any file is accepted.
uniquefalseLets at most one row reference each upload.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

files

The files field in the dashboard

An ordered list of references to uploaded files, stored in a junction table.

OptionDefaultWhat it does
allowEmptytrueAccepts an empty list. With false, a written [] is rejected, so the field needs at least one upload.
default[]A function that returns the list a create stores when its input leaves the field out.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The most links a written list may hold.
maxSize-The largest file accepted, in bytes or as a size like '5mb'.
min-The fewest links a written list may hold.
minSize-The smallest file accepted, in bytes or as a size like '10kb'.
onDelete'cascade'What happens to a link when its upload is deleted: 'cascade' removes the link, and 'restrict' blocks the delete.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtruefalse stops search from finding records through these files.
translatablefalseKeeps one list per locale. Top-level collection fields only.
types-The media types accepted, as exact types, wildcards, or categories. Omitted, any file is accepted.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

image

The image field in the dashboard

A reference to one uploaded image, stored as its UUID. It is always nullable and always indexed, so no option makes it required.

OptionDefaultWhat it does
default-The value a create stores when its input leaves the field out. A value, or a function that computes one.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
maxHeight-The most pixels tall an accepted image is.
maxSize-The largest file accepted, in bytes or as a size like '5mb'.
maxWidth-The most pixels wide an accepted image is.
minHeight-The fewest pixels tall an accepted image is.
minSize-The smallest file accepted, in bytes or as a size like '10kb'.
minWidth-The fewest pixels wide an accepted image is.
onDelete'setNull'What happens when the upload is deleted: 'setNull' clears the reference, 'cascade' deletes this row, and 'restrict' blocks the delete.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtruefalse stops search from finding records through this image.
translatablefalseKeeps one reference per locale. Top-level collection fields only.
types['image']The media types accepted, as exact types, wildcards, or categories. The file must be an image either way.
uniquefalseLets at most one row reference each upload.
uniquePerLocalefalseLimits unique to one locale. Needs unique and translatable.
uniquePerParentfalseLimits unique to each record's own list, inside a repeater. Needs unique.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

images

The images field in the dashboard

An ordered list of references to uploaded images, stored in a junction table.

OptionDefaultWhat it does
allowEmptytrueAccepts an empty list. With false, a written [] is rejected, so the field needs at least one upload.
default[]A function that returns the list a create stores when its input leaves the field out.
description-Help text below the label, as markdown. A string, a message key, or an object that starts it collapsed.
immutablefalseLocks the field after create: creates accept it, updates reject it. Top-level collection fields only.
label-The label the dashboard shows, as a string or a message key. Omitted, the field name is sentence-cased.
max-The most links a written list may hold.
maxHeight-The most pixels tall an accepted image is.
maxSize-The largest file accepted, in bytes or as a size like '5mb'.
maxWidth-The most pixels wide an accepted image is.
min-The fewest links a written list may hold.
minHeight-The fewest pixels tall an accepted image is.
minSize-The smallest file accepted, in bytes or as a size like '10kb'.
minWidth-The fewest pixels wide an accepted image is.
onDelete'cascade'What happens to a link when its upload is deleted: 'cascade' removes the link, and 'restrict' blocks the delete.
placeholder-The hint an empty input shows, as a string or a message key.
readabletruefalse makes the field write-only: no read returns it.
sanitizers-Functions that clean the value before it is validated.
searchtruefalse stops search from finding records through these images.
translatablefalseKeeps one list per locale. Top-level collection fields only.
types['image']The media types accepted, as exact types, wildcards, or categories. The file must be an image either way.
validators-Functions that reject a value by returning a message.
when-A condition that turns the field on or off per record.
writabletruefalse removes the field from write inputs, so its value comes from default.

fileName

A text value stored the way the uploads layer names files: Sunset At Sea.JPG becomes sunset-at-sea.jpg. It takes every text option. Search reads a typed word the same way, so Übersicht finds ubersicht-q3-final.pdf.

directoryName

A text value stored as a folder path: Photos/2024 Summer becomes photos/2024-summer. It takes every text option, and search reads a typed word the same way.