# Field

The `<field>` tag is very handy if you want to display content that looks like a field on a document. Each field needs to define a `title`. This is displayed according to the type chosen in `type`.

When a document is rendered "editable" fields also automatically display as editable content in the PDF viewer.

It can only be used within a [`<body>`](/document-xml-adx/adx-elements/body.md).

## Example

```xml
<field title="The title of this field" type="line_above">
  The value of the field
</field>
```

## Attributes

**`title`**

The title of the field. Must the give, but can also be provided as a child component, i.e. with

```xml
<field>
  <title>TITLE</title>
  <value>VALUE</value>
</field>
```

**`class` (optional)**

The style class to define how the content looks like. If nothing is specified this is taken from the special class "field\_content"

**`titleClass` (optional)**

The style class to define how the title looks like. If nothing is specified this is taken from the special class "field\_title"

**`spaceAboveLine` (optional)** *New in Atfinity 15*

In fields that display a line, this is the space above the line (in pt, mm or cm)

**`spaceBelowLine` (optional)** *New in Atfinity 15*

In fields that display a line, this is the space below the line (in pt, mm or cm)

**`titleWidth` (optional)** *New in Atfinity 15*

In fields that display the title left of the value, this is the width of the title (in pt, mm or cm)

**`fieldWidth` (optional)**

The width of the field's value area (in pt, mm or cm). Defaults to `2.5cm`. Used as a fallback when `titleWidth` is not set on the content style.

**`minLines` (optional)**

The minimum number of lines the field's value should occupy. Useful for ensuring consistent field height when the value is short or empty.

**`color` (optional)**

The text color of the field value. Can be a named color or an RGB value.

**`fontSize` (optional)**

The font size of the field value in pt, mm or cm.

**`align` (optional)**

Text alignment of the field value: `left`, `right`, `center`, or `justify`.

**`spaceBefore` (optional)**

Adds space (in pt, mm or cm) before the field.

**`spaceAfter` (optional)**

Adds space (in pt, mm or cm) after the field.

**`type` (optional)**

The main styling option of the field. Available types are `line_below`, `line_right`, `line_above`, `box_below`, and `box_right`. If nothing is specified the `box_below` type is used.

**`editable`** (optional)

This overwrites the automatic behaviour to display a field as editable. If you set `editable="false"` the field can never be edited. If you set it to `editable="true"` the field can always be edited, even when rendered in a normal PDF.

<details>

<summary></summary>

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/document-xml-adx/adx-elements/field.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
