# Zucms

## Field Types

> Category: Models

---

## Pages

- [Introduction](https://docs.zucms.co/introduction)

### API

- [RESTful API](https://docs.zucms.co/api/rest)
- [Typescript SDK](https://docs.zucms.co/api/typescript)

### Getting Started

- [Quick Start](https://docs.zucms.co/getting-started/quick-start)
- [Core Concepts](https://docs.zucms.co/getting-started/core-concepts)

### Models

- [Overview](https://docs.zucms.co/models/overview)
- [Field Types](https://docs.zucms.co/models/field-types)
- [Relations](https://docs.zucms.co/models/relations)

### Content

- [Working with Entries](https://docs.zucms.co/content/working-with-entries)
- [Localization](https://docs.zucms.co/content/localization)

### Access & Security

- [Roles](https://docs.zucms.co/access-security/roles)
- [Access Policies](https://docs.zucms.co/access-security/access-policies)

### Organization

- [Members & Roles](https://docs.zucms.co/organization/members-roles)
- [Audit Log](https://docs.zucms.co/organization/audit-log)
- [Billing & Plans](https://docs.zucms.co/organization/billing-plans)

---

# Field Types

Every field has a **data type** that defines what kind of value it stores, and an **input type** that defines how editors interact with it in the UI.

## Data types

### `string`

A short piece of text. Stored as a single string value.

Available input types:

| Input | Description |
|---|---|
| `text` | Single-line text input |
| `textarea` | Multi-line plain text |
| `wysiwyg` | Rich text editor (Tiptap) |
| `markdown` | Markdown editor with preview |
| `code` | Syntax-highlighted code editor |
| `json` | JSON editor with validation |

### `text`

Long-form text, typically used for body content. Stored as a string but intended for longer values.

Same input options as `string`.

### `number`

A numeric value (integer or float).

| Input | Description |
|---|---|
| `number` | Plain number input |
| `slider` | Drag to set a value within a range |
| `stepper` | Increment/decrement buttons |
| `rating` | Star rating (1–5) |
| `percentage` | 0–100 % input |
| `currency` | Formatted currency input |

### `boolean`

A `true` / `false` toggle.

| Input | Description |
|---|---|
| `switch` | Toggle switch |
| `checkbox` | Checkbox |

### `date`

A date or datetime value.

| Input | Description |
|---|---|
| `date` | Date picker |
| `datetime` | Date + time picker |
| `time` | Time picker only |

### `enum`

A field whose value must be one of a fixed list of options you define.

| Input | Description |
|---|---|
| `select` | Single-value dropdown |
| `multi-select` | Multiple values dropdown |
| `radio` | Radio button group |
| `segmented` | Segmented control |
| `tags` | Tag pills, multiple values |
| `color` | Color picker where values map to colors |

### `relation`

A link to entries in another model (or the same model). See the [Relations](/models/relations) page for details.

### `file`

A reference to an uploaded file. Files are stored in BunnyCDN and referenced by ID.

## Field options

Every field shares these common options:

| Option | Description |
|---|---|
| **Required** | The entry cannot be saved without a value |
| **Help text** | A short hint shown below the input |
| **Placeholder** | Placeholder text shown when the field is empty |
| **Default value** | Pre-filled value for new entries |
| **Localizable** | Store a different value per locale (`string`, `text`, and `enum` only) |

## Changing a field's data type

Changing the data type of an existing field that already has entries triggers the **Migration Assistant**. It shows how values will be converted and lets you choose a fallback strategy before applying the change.
