ContentSchema
Interface
The field schema of a structured category. Articles in that category fill customData
according to it, instead of a free-form body.
Property | Type | Optional | Description |
|---|---|---|---|
|
| No | Field definitions, in editor order. Each |
SchemaField
Interface
A single field definition in a content schema. Defines the structure, constraints, and display properties of one custom field.
Property | Type | Optional | Description |
|---|---|---|---|
|
| Yes | Value pre-filled on new content, of the type matching |
|
| Yes | Sub-fields of an |
|
| Yes | Help text shown below the field in the admin editor. |
|
| Yes | Label of one item in the admin editor of an |
|
| No | Property name in |
|
| No | Label shown above the field in the admin editor. Not part of the data. |
|
| Yes | Maximum number of items of an |
|
| Yes | Minimum number of items of an |
|
| Yes | Options of a |
|
| Yes | Placeholder shown in the empty input of the admin editor. |
|
| Yes | Whether a value is required when saving. Defaults to |
|
| No | Field type, which sets the value shape in |
|
| Yes | Validation rules for this field. See SchemaFieldValidation. |
SchemaFieldOption
Interface
An option of a select or multiselect field.
Property | Type | Optional | Description |
|---|---|---|---|
|
| No | Label shown in the admin editor. Example: |
|
| No | Value stored in |
SchemaFieldType
TypeAlias
Field types of a content schema, and the value each one takes in customData:
Type | Value in customData |
|---|---|
| Plain text string |
| Multi-line text string |
| HTML string (converted from TipTap editor) |
| Numeric value (integer or float) |
|
|
| Single string from the options list |
| Array of strings from the options list |
| Object |
| Object |
| Full URL string (validated) |
| Email address string (validated) |
| ISO 8601 date string ( |
| ISO 8601 datetime string |
| Hex color string (e.g. |
| Nested object with sub-fields |
| Array of objects with sub-fields |
| Resolved data from a DataSource reference |
type SchemaFieldType = "string" | "text" | "richtext" | "number" | "boolean" | "select" | "multiselect" | "image" | "file" | "url" | "email" | "date" | "datetime" | "color" | "object" | "array" | "dataSource"SchemaFieldValidation
Interface
Validation rules of a schema field. Rules that do not fit the field's type are ignored.
Property | Type | Optional | Description |
|---|---|---|---|
|
| Yes | Maximum value, inclusive. For |
|
| Yes | Maximum text length, inclusive. For |
|
| Yes | Minimum value, inclusive. For |
|
| Yes | Minimum text length, inclusive. For |
|
| Yes | JavaScript regular expression source, without delimiters or flags, for |