> For the complete documentation index, see [llms.txt](https://redd.gitbook.io/react-advanced-form/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://redd.gitbook.io/react-advanced-form/hoc/create-field/presets.md).

# Field presets

Presets contain pre-defined `createField` [options](/react-advanced-form/hoc/create-field/options.md) 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://redd.gitbook.io/react-advanced-form/hoc/create-field/presets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
