# FieldElementProps

> This document is the Markdown version of [formisch.dev/svelte/api/FieldElementProps/](https://formisch.dev/svelte/api/FieldElementProps/). For the complete documentation index, see [llms.txt](https://formisch.dev/llms.txt).

Props to spread onto a field element for integration with Svelte form handling.

## Definition

- `FieldElementProps`
  - `name` `string`
  - `autofocus` `boolean`
  - `[ref: symbol]` `(element: FieldElement) => () => void`
  - `onfocus` `() => void`
  - `oninput` `FormEventHandler<FieldElement>`
  - `onchange` `FormEventHandler<FieldElement>`
  - `onblur` `() => void`

### Explanation

`onfocus` marks the field as touched and runs the configured `'touch'` validation, while `onblur` runs the configured `'blur'` validation. Neither handler uses the event object, so both are typed as `() => void` and can be passed to native elements or custom components with different focus event types.
