> Markdown version of [Field Components](https://vaadin.com/docs/next/flow/react-views/forms/field-components). Section index: [llms.txt](https://vaadin.com/docs/next/flow/llms.txt)

# Field Components

The `field()` function binds the following Vaadin components. Each component edits a property of one of the listed Java types:

| Component                                                                                                                                                                                                                                                                                  | Java type of the property                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| [Text Field](https://vaadin.com/docs/next/components/text-field.md), [Text Area](https://vaadin.com/docs/next/components/text-area.md), [Password Field](https://vaadin.com/docs/next/components/password-field.md), [Email Field](https://vaadin.com/docs/next/components/email-field.md) | `String`                                                                                                                |
| [Integer Field, Number Field](https://vaadin.com/docs/next/components/number-field.md)                                                                                                                                                                                                     | A number type, such as `int`, `Integer`, `double`, or `BigDecimal`                                                      |
| [Checkbox](https://vaadin.com/docs/next/components/checkbox.md)                                                                                                                                                                                                                            | `boolean`                                                                                                               |
| [Date Picker](https://vaadin.com/docs/next/components/date-picker.md)                                                                                                                                                                                                                      | `LocalDate`                                                                                                             |
| [Time Picker](https://vaadin.com/docs/next/components/time-picker.md)                                                                                                                                                                                                                      | `LocalTime`                                                                                                             |
| [Date Time Picker](https://vaadin.com/docs/next/components/date-time-picker.md)                                                                                                                                                                                                            | `LocalDateTime`                                                                                                         |
| [Select](https://vaadin.com/docs/next/components/select.md), [Radio Button Group](https://vaadin.com/docs/next/components/radio-button.md)                                                                                                                                                 | `String` or an enum, matched to the values of the items                                                                 |
| [Combo Box](https://vaadin.com/docs/next/components/combo-box.md)                                                                                                                                                                                                                          | `String` or an enum, matched to the values of the items, or an object, which is the selected item                       |
| [Checkbox Group](https://vaadin.com/docs/next/components/checkbox.md)                                                                                                                                                                                                                      | A list or a set of `String`                                                                                             |
| [Multi-Select Combo Box](https://vaadin.com/docs/next/components/multi-select-combo-box.md)                                                                                                                                                                                                | A list or a set of the items                                                                                            |
| [Custom Field](https://vaadin.com/docs/next/components/custom-field.md)                                                                                                                                                                                                                    | `String`. By default, the value combines the values of the fields inside the custom field, separated by tab characters. |
| [Rich Text Editor](https://vaadin.com/docs/next/components/rich-text-editor.md)                                                                                                                                                                                                            | `String`, in the Delta format of the editor                                                                             |

For example, a combo box can edit a `Country` property of a form, when its items are `Country` objects:

```tsx
<ComboBox label="Country" items={countries} itemLabelPath="name" itemValuePath="name" {...field(model.country)} />
```

See [Changing Values from Code](https://vaadin.com/docs/next/flow/react-views/forms/form-state.md#changing-values) for the whole example.

When the user empties a number field, the value of a nullable number becomes `undefined`. A non-nullable number becomes `NaN`, and the field shows the error "must be a number".

The `field()` function throws an error for a component that isn’t a field, such as a [List Box](https://vaadin.com/docs/next/components/list-box.md). It doesn’t read the state of a [Switch](https://vaadin.com/docs/next/components/switch.md), so use a checkbox for a `boolean` property instead.
