Fields & Types
Field Types
Section titled “Field Types”ACMS supports the following field types:
| Type | Description | Editor |
|---|---|---|
string | Short text | Single-line input |
text | Long text | Multi-line textarea |
number | Numeric values | Number input |
boolean | True/false | Toggle switch |
array | Lists of items | List editor with add/remove/reorder |
object | Nested groups | Grouped fields |
image | Image URLs | Image input (with preview) |
Field types are stored in the _meta section of acms.json and can be changed via the dashboard or API.
Auto-Detection and Type Inference
Section titled “Auto-Detection and Type Inference”ACMS infers field types from usage context:
- Accessing a field in an
<img src>attribute suggests animagetype - Numeric comparisons suggest a
numbertype - Boolean conditionals suggest a
booleantype - Array methods (
.map,.forEach) suggest anarraytype
The inferred type is stored in metadata and determines which editor is shown in the dashboard.
Field Metadata
Section titled “Field Metadata”Every field has an entry in _meta that tracks:
{ "_meta": { "hero.title": { "type": "string", "lastAccessed": "2025-01-15T10:30:00.000Z" } }}- type — The field type (determines the editor in the dashboard)
- lastAccessed — Timestamp of the last time this field was accessed in code (used by purge to remove unused fields)
- label — Optional human-readable label
- defaultValue — Optional default value
- itemType — For
arrayfields, the type of each item
Changing Field Types
Section titled “Changing Field Types”You can change a field’s type in three ways:
- Dashboard — Click the type badge next to any field to change it
- API —
PATCH /api/field/:path/metawith a newtypevalue - Manually — Edit the
_metasection ofacms.json
Next Steps
Section titled “Next Steps”- Understand Content Strategies for build-time vs runtime delivery
- Set up TypeScript for full type safety