Scalar fields store a single primitive value — a string, a number, a boolean, or a date. They are the most common fields in any content type and cover the majority of straightforward editorial inputs. All scalar field factories live in theDocumentation 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.
Field namespace exported by alinea.
Importing Field
Field.text
Field.text renders a single-line or multi-line text input and stores its value as a string. The initial value defaults to an empty string.
Using Field.text
Human-readable label shown in the dashboard above the input.
When
true, the input expands to accept line breaks (a <textarea>). Defaults to false.Renders a compact, borderless version of the field. Useful inside list rows or object fields.
Maps to the HTML
type attribute of the underlying input element, enabling browser-native validation and keyboard hints on mobile.Short hint text displayed inside the input when it is empty.
Focuses this input automatically when the entry form opens.
A React component rendered as an icon on the left side of the input.
A React component rendered as an icon on the right side of the input.
When
true, the text value of this field is indexed and searchable from the dashboard and query layer.Instructional text rendered below the label. Accepts JSX for rich formatting.
A fraction of the form width (0–1) that this field should occupy. Use
0.5 to place two fields side by side.Marks the field as required. Saving the entry fails if the value is empty.
Prevents editing the value in the dashboard.
Hides the field from the dashboard UI entirely.
When using i18n, a shared field stores a single value across all locales instead of one per locale.
The value used when a new entry is created.
A synchronous validation function. Return
undefined or true to pass, a string error message to fail.Field.number
Field.number renders a numeric input and stores its value as number | null. A null value means the field has not been filled in.
Using Field.number
The minimum permitted value.
The maximum permitted value.
The increment between legal values. For example,
step: 0.5 allows 0, 0.5, 1, 1.5, and so on.Instructional text below the label.
Fractional form width (0–1).
Compact, borderless rendering.
Marks the field as required. Saving the entry fails if the value is empty.
Prevents editing the value in the dashboard.
Hides the field from the dashboard UI entirely.
When using i18n, a shared field stores a single value across all locales instead of one per locale.
The value used when a new entry is created.
A synchronous validation function. Return
undefined or true to pass, a string error message to fail.Field.select
Field.select renders a dropdown and stores one of the predefined option keys as a string. When no initialValue is provided the field value is null until the user makes a selection.
Using Field.select
options object maps option keys (stored in the database) to human-readable labels (shown in the dropdown). TypeScript infers a union type from the option keys at the point of definition — for example, 'draft' | 'review' | 'published' above.
An object mapping option keys to display labels.
The key of the option that is selected when a new entry is created. When set, the return type becomes the union of keys (not nullable).
Text shown in the dropdown before a value is selected.
Instructional text rendered below the label.
Compact, borderless rendering. Useful inside list rows or object fields.
Fractional form width (0–1).
Field.check
Field.check renders a checkbox and stores a boolean. The initial value is false.
Using Field.check
Short text shown next to the checkbox, explaining the toggle.
Focuses this input automatically when the entry form opens.
Fractional form width (0–1).
Additional instructional text below the label.
Compact, borderless rendering.
Field.date
Field.date renders a date picker and stores an ISO 8601 date string (e.g. "2024-06-15"). The value is string — no Date object is involved at the data layer, keeping serialisation predictable.
Using Field.date
Marks the field as required.
Focuses this input automatically when the entry form opens.
Fractional form width (0–1).
Compact, borderless rendering.
Instructional text below the label.
Field.time
Field.time renders a time picker and stores the selected time as a string (e.g. "14:30"). It supports optional minValue, maxValue, and step constraints, mirroring the HTML <input type="time"> API.
Using Field.time
The earliest permitted time string (e.g.
"09:00").The latest permitted time string (e.g.
"18:00").The step interval in seconds. For example,
900 enforces 15-minute intervals.Focuses this input automatically when the entry form opens.
Compact, borderless rendering.
Field.code
Field.code renders a syntax-highlighted code editor and stores its value as a string. Use the language option to hint the editor which syntax to apply.
Using Field.code
A language identifier string (e.g.
"typescript", "css", "bash") used for syntax highlighting.Instructional text below the label.
Compact, borderless rendering.
Fractional form width (0–1).
Field.json
Field.json renders a JSON editor and stores the raw parsed value. It is generic — Field.json<MyType>(...) — so the TypeScript type of the stored value can be anything JSON-serialisable.
Using Field.json
Focuses this input automatically when the entry form opens.
Instructional text below the label.
Compact, borderless rendering.
Fractional form width (0–1).
Field.path
Field.path stores a URL path segment string (e.g. "my-post-title"). It can be configured to automatically derive its value from another field via the from option.
The
shared option is not supported on path fields — Alinea will throw an error at boot time if you set shared: true on a path field.Using Field.path
The key of another field in the same type. When the referenced field changes, the path is automatically re-derived (slugified) from that value.
Prevents editing the path in the dashboard after it is set.
Hides the path field from the dashboard form.
Fractional form width (0–1).