# insert

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

Inserts a new item into a field array at the specified index. All items at or after the insertion point are shifted up by one index.

```ts
insert<TSchema, TFieldArrayPath>(form, config);
```

## Generics

- `TSchema` `extends FormSchema`
- `TFieldArrayPath` `extends RequiredPath`

## Parameters

- `form` `BaseFormStore<TSchema>`
- `config` `InsertConfig<TSchema, TFieldArrayPath>`

### Explanation

The `form` parameter is the form store containing the field array. The `config` parameter specifies the path to the field array, the index where to insert the new item, and optional initial input values for the new item.

## Related

### Primitives

[`useForm`](/react/api/useForm.md), [`useFieldArray`](/react/api/useFieldArray.md)

### Methods

[`move`](/methods/api/move.md), [`remove`](/methods/api/remove.md), [`replace`](/methods/api/replace.md), [`swap`](/methods/api/swap.md)
