# Field presets

Presets contain pre-defined `createField` [options](https://redd.gitbook.io/react-advanced-form/hoc/create-field/options) relevant to the respective field type. Those options ensure proper field behavior as well as automatically map essential form element's props (i.e. `placeholder`, `multiselect`, etc.) from the wrapped component to the actual form element.

Presets are designed for seamless integration of common field types. For the custom fields you may want to consider writing your own presets or extending the existing ones.

## Presets list

There are field presets for all common field types. Those should provide a sensible defaults, therefore it is recommended to use them when declaring a respective field component.

* `fieldPresets.input`
* `fieldPresets.textarea`
* `fieldPresets.checkbox`
* `fieldPresets.select`
* `fieldPresets.radio`

## Example

### Basic

```jsx
import React from 'react'
import { createField, fieldPresets } from 'react-advanced-form'

const Select = ({ children, fieldProps }) => (
  <select {...fieldProps}>
    {children}
  </select>
)

export default createField(fieldPresets.select)(Select)
```

### Extending a preset

```javascript
import React from 'react'
import { createField, fieldPresets } from 'react-advanced-form'

const DateSelect = ({ children, fieldProps }) => (
  <select {...fieldProps}>
    {children}
  </select>
)

export default createField({
  ...fieldPresets.select,
  valuePropName: 'selectedDate',
})(DateSelect)
```


---

# 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://redd.gitbook.io/react-advanced-form/hoc/create-field/presets.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.
