Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/alineacms/alinea/llms.txt

Use this file to discover all available pages before exploring further.

Fields are the building blocks of every content type in Alinea. When you define a document or page type using Config.document or Config.type, you supply a fields object whose values are field instances. Each field describes the data shape of one property — what TypeScript type it produces, how it is stored in the git repository, and which control renders in the dashboard. All built-in field factories are accessed through the Field namespace, which is a named export of the alinea package. You never import individual field modules directly; everything you need is available from the top-level import.
Importing fields
import {Field} from 'alinea'

Field categories

Text & Number

Scalar inputs: text, number, select, check, date, time, code, JSON, and path

Rich Text

Block-based rich text editor with inline marks and custom embedded blocks

Links & Media

Entry references, image picker, file picker, polymorphic links, and URL fields

Layout

Repeating lists, nested objects, tab groups, and SEO metadata

Custom Fields

Define your own field type with a custom React view component

All built-in fields

The table below lists every factory exported from the Field namespace, the TypeScript value type it produces, and its primary use case.
Field factoryValue typeDescription
Field.textstringSingle-line or multi-line text input
Field.numbernumber | nullNumeric input with optional min, max, and step
Field.selectstring | nullDropdown of predefined string options
Field.checkbooleanBoolean checkbox
Field.datestringISO 8601 date string
Field.timestringTime string (e.g. "14:30")
Field.codestringCode editor with optional language hint
Field.jsonTRaw JSON value; generic over the stored type
Field.pathstringURL path segment, optionally derived from another field
Field.richTextTextDoc<Blocks>Structured rich text document
Field.listArray<Row>Repeating list of typed rows
Field.objectobjectNested object with its own fields
Field.entryEntryLinkReference to another content entry
Field.imageImageLinkReference to an image in the media library
Field.fileFileLinkReference to a file in the media library
Field.linkLinkPolymorphic link — entry, URL, or file
Field.urlUrlLinkURL picker that stores a URL reference
Field.metadataMetadataStructured SEO metadata block
Field.tabs(section)Groups fields under tab controls in the dashboard
Field.tabTypeA single tab definition; used inside Field.tabs
Field.view(section)Renders a custom React node in the entry form

Basic usage example

cms.config.ts
import {Config, Field} from 'alinea'

export const BlogPost = Config.document('Blog post', {
  fields: {
    title: Field.text('Title', {required: true}),
    publishedAt: Field.date('Published at'),
    featured: Field.check('Featured post'),
    body: Field.richText('Body text'),
    hero: Field.image('Hero image')
  }
})
Every field factory accepts a human-readable label as its first argument and an optional options object as its second argument. Options that apply to all fields — required, readOnly, hidden, shared, initialValue, and validate — are defined on the base FieldOptions interface and are available on every field type.

Build docs developers (and LLMs) love