# MergeFieldDefinition

interface

The definition of a single merge field.

Depending on the [type](#member-type), some of the properties may not be relevant:

* For `text` merge fields, the `id`, `label`, and `defaultValue` properties are used.
* For `block` merge fields, the `id`, `label`, `height`, and `defaultValue` properties are used.
* For `image` merge fields, the `id`, `label`, `height`, `width`, and `defaultValue` properties are used.

<a id="properties">

## Properties

<a id="member-defaultValue">

### `defaultValue?: MergeFieldDataSetValue`

Default value of the merge field.

It is used if a value for given merge field has not been provided in a data set and in the default values preview mode.

<a id="member-height">

### `height?: number`

The height of the non-text merge field in pixels.

It is used only for merge fields of type `block` and `image`. If unset, the default height for block is 120 pixels and for image - 400 pixels.

Defaults to `120 (for block)/ 400 (for image)`

<a id="member-id">

### `id: string`

The unique identifier of the merge field.

If [label](#member-label) is not specified, the ID will be used as a label.

The list of allowed characters includes: `a-z`, `A-Z`, `0-9`, `_`, `.`, and `-`.

<a id="member-label">

### `label?: string`

The human-readable label of the merge field.

It is displayed by the feature's UI and inside the editing area.

<a id="member-type">

### `type?: MergeFieldType`

The type of the merge field. It determines how the merge field is rendered in the editor editing area.

Possible options are `text` (meaning the merge field will be inline), `block` and `image`.

Defaults to `'text'`

<a id="member-width">

### `width?: number`

The width of the image merge field in pixels.

It is used only for merge fields of type `image`. If unset, the default width is 400 pixels.

Defaults to `400`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
