Skip to content

Field Types

Arche CMS provides 29 field types covering a wide range of content modeling needs.

Text & Rich Content

FieldImportDescription
text@arche-cms/schemaSingle-line text input
textarea@arche-cms/schemaMulti-line text area
richText@arche-cms/schemaRich text editor (Tiptap-based)
markdown@arche-cms/schemaMarkdown editor
code@arche-cms/schemaCode editor with syntax highlighting
slug@arche-cms/schemaURL-friendly slug, auto-generated from a source field

Numeric & Boolean

FieldImportDescription
number@arche-cms/schemaNumeric input (integer or float)
boolean@arche-cms/schemaTrue/false toggle
checkbox@arche-cms/schemaSingle checkbox

Date & Time

FieldImportDescription
date@arche-cms/schemaDate picker (YYYY-MM-DD)
datetime@arche-cms/schemaDate and time picker

Media & Files

FieldImportDescription
media@arche-cms/schemaSingle media/file upload
upload@arche-cms/schemaMultiple file upload

Choice Fields

FieldImportDescription
select@arche-cms/schemaSingle-select dropdown
multiSelect@arche-cms/schemaMulti-select dropdown
radio@arche-cms/schemaRadio button group

Relational

FieldImportDescription
relation@arche-cms/schemaReference to another collection

Structured

FieldImportDescription
componentField@arche-cms/schemaReusable component instance
dynamicZone@arche-cms/schemaDynamic zone (choose one of multiple components)
arrayField@arche-cms/schemaArray of sub-fields
objectField@arche-cms/schemaGrouped sub-fields
groupField@arche-cms/schemaNamed field group
tabsField@arche-cms/schemaTabbed interface for organizing fields
repeater@arche-cms/schemaRepeatable set of fields

Utility

FieldImportDescription
email@arche-cms/schemaEmail input with validation
password@arche-cms/schemaPassword input
url@arche-cms/schemaURL input with validation
json@arche-cms/schemaJSON editor
color@arche-cms/schemaColor picker

Validation

Each field supports validation options:

ts
text("title", {
  validation: {
    required: true,
    minLength: 3,
    maxLength: 100,
    pattern: "^[a-zA-Z0-9 ]+$",
  },
});

number("age", {
  validation: {
    required: true,
    min: 0,
    max: 150,
  },
});

Complete Example

ts
import {
  defineCollection,
  text,
  number,
  boolean,
  date,
  email,
  url,
  json,
  richText,
  markdown,
  code,
  color,
  media,
  upload,
  select,
  multiSelect,
  radio,
  checkbox,
  relation,
  componentField,
  dynamicZone,
  arrayField,
  objectField,
  groupField,
  tabsField,
  repeater,
  slug,
  password,
} from "@arche-cms/schema";

export default defineCollection({
  slug: "examples",
  labels: { singular: "Example", plural: "Examples" },
  fields: [
    text("title", { validation: { required: true } }),
    textarea("description"),
    number("order", { validation: { min: 0 } }),
    boolean("featured"),
    date("publishDate"),
    email("contactEmail"),
    url("website"),
    json("metadata"),
    richText("content"),
    markdown("readme"),
    code("snippet", { language: "typescript" }),
    color("accentColor"),
    media("coverImage"),
    upload("gallery"),
    select("status", { options: ["draft", "published", "archived"] }),
    multiSelect("tags", { options: ["news", "tech", "design"] }),
    radio("layout", { options: ["default", "full-width", "compact"] }),
    checkbox("showInMenu"),
    relation("author", { to: "users" }),
    componentField("seo", { component: "seo" }),
    dynamicZone("blocks", { components: ["hero", "cta", "faq"] }),
    arrayField("links", { fields: [text("label"), url("url")] }),
    objectField("settings", { fields: [text("theme"), boolean("darkMode")] }),
    groupField("social", { fields: [url("twitter"), url("github")] }),
    tabsField("details", { tabs: [{ label: "Content", fields: ["title", "body"] }] }),
    repeater("faq", { fields: [text("question"), textarea("answer")] }),
    slug("slug", { from: "title" }),
    password("secretKey"),
  ],
});

Released under the MIT License.