Open History to see the last commit
1---
2id: FieldApi
3title: FieldApi
4---
5β
6Defined in: [FieldApi/FieldApi.public.ts:123](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L123)
7β
8## Type Parameters
9β
10### TFieldName
11β
12`TFieldName`
13β
14### TFieldValue
15β
16`TFieldValue`
17β
18### TFieldError
19β
20`TFieldError`
21β
22### TFormData
23β
24`TFormData`
25β
26### TFormErrorTypes
27β
28`TFormErrorTypes` *extends* [`FormErrorTypes`](FormErrorTypes.md)
29β
30## Properties
31β
32### atom
33β
34```ts
35atom: ReadonlyAtom<FieldState<TFieldValue, TFieldError>>;
36```
37β
38Defined in: [FieldApi/FieldApi.public.ts:206](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L206)
39β
40***
41β
42### clearValues
43β
44```ts
45clearValues: FieldClearValuesFn;
46```
47β
48Defined in: [FieldApi/FieldApi.public.ts:179](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L179)
49β
50Clear all values from this field's array.
51If this field is not an array, this method will be ignored.
52β
53#### Param
54β
55**options**
56β
57Optional update options
58β
59***
60β
61### errors
62β
63```ts
64errors: FieldErrors<TFieldError>;
65```
66β
67Defined in: [FieldApi/FieldApi.public.ts:212](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L212)
68β
69***
70β
71### filterValues
72β
73```ts
74filterValues: FieldFilterValuesFn<TFieldValue>;
75```
76β
77Defined in: [FieldApi/FieldApi.public.ts:204](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L204)
78β
79Filter the values in this field's array using a predicate function.
80If this field is not an array, this method will be ignored.
81β
82#### Param
83β
84**predicate**
85β
86The predicate function to filter values. Returns true to keep the value, false to remove it.
87β
88#### Param
89β
90**options**
91β
92Optional update options including a custom `thisArg` for the predicate
93β
94***
95β
96### form
97β
98```ts
99form: FormApi<TFormData, TFormErrorTypes>;
100```
101β
102Defined in: [FieldApi/FieldApi.public.ts:133](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L133)
103β
104The form that owns this field.
105β
106***
107β
108### handleBlur
109β
110```ts
111handleBlur: FieldVoidFn;
112```
113β
114Defined in: [FieldApi/FieldApi.public.ts:216](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L216)
115β
116***
117β
118### handleChange
119β
120```ts
121handleChange: FieldHandleChangeFn<TFieldValue>;
122```
123β
124Defined in: [FieldApi/FieldApi.public.ts:214](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L214)
125β
126***
127β
128### insertValue
129β
130```ts
131insertValue: FieldInsertValueFn<TFieldValue>;
132```
133β
134Defined in: [FieldApi/FieldApi.public.ts:172](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L172)
135β
136Insert a new value into this field's array at the specified index.
137If this field is not an array, this method will be ignored.
138β
139#### Param
140β
141**index**
142β
143The index at which to insert the value
144β
145#### Param
146β
147**value**
148β
149The value to insert
150β
151#### Param
152β
153**options**
154β
155Optional update options
156β
157***
158β
159### meta
160β
161```ts
162meta: FieldMeta<TFieldError>;
163```
164β
165Defined in: [FieldApi/FieldApi.public.ts:210](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L210)
166β
167***
168β
169### moveValue
170β
171```ts
172moveValue: FieldMoveValueFn;
173```
174β
175Defined in: [FieldApi/FieldApi.public.ts:155](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L155)
176β
177Move an element in this field's array from one index to another.
178If this field is not an array, this method will be ignored.
179β
180#### Param
181β
182**fromIndex**
183β
184The current index of the element to move
185β
186#### Param
187β
188**toIndex**
189β
190The index to move the element to
191β
192#### Param
193β
194**options**
195β
196Optional update options
197β
198***
199β
200### pushValue
201β
202```ts
203pushValue: FieldPushValueFn<TFieldValue>;
204```
205β
206Defined in: [FieldApi/FieldApi.public.ts:163](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L163)
207β
208Push a new value into this field's array.
209If this field is not an array, this method will be ignored.
210β
211#### Param
212β
213**value**
214β
215The value to push into the array
216β
217#### Param
218β
219**options**
220β
221Optional update options
222β
223***
224β
225### removeValue
226β
227```ts
228removeValue: FieldRemoveValueFn;
229```
230β
231Defined in: [FieldApi/FieldApi.public.ts:196](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L196)
232β
233Remove a value from this field's array at the specified index.
234If this field is not an array, this method will be ignored.
235β
236#### Param
237β
238**index**
239β
240The index of the value to remove
241β
242#### Param
243β
244**options**
245β
246Optional update options
247β
248***
249β
250### replaceValue
251β
252```ts
253replaceValue: FieldReplaceValueFn<TFieldValue>;
254```
255β
256Defined in: [FieldApi/FieldApi.public.ts:188](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L188)
257β
258Replace the value at the specified index in this field's array.
259If this field is not an array, this method will be ignored.
260β
261#### Param
262β
263**index**
264β
265The index of the value to replace
266β
267#### Param
268β
269**value**
270β
271The new value
272β
273#### Param
274β
275**options**
276β
277Optional update options
278β
279***
280β
281### reset
282β
283```ts
284reset: FieldVoidFn;
285```
286β
287Defined in: [FieldApi/FieldApi.public.ts:218](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L218)
288β
289***
290β
291### swapValues
292β
293```ts
294swapValues: (indexA, indexB) => void;
295```
296β
297Defined in: [FieldApi/FieldApi.public.ts:146](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L146)
298β
299Swap two elements in this field's array.
300If this field is not an array, this method will be ignored.
301β
302#### Parameters
303β
304##### indexA
305β
306`number`
307β
308The index of the first element to swap
309β
310##### indexB
311β
312`number`
313β
314The index of the second element to swap
315β
316#### Returns
317β
318`void`
319β
320***
321β
322### value
323β
324```ts
325value: TFieldValue;
326```
327β
328Defined in: [FieldApi/FieldApi.public.ts:208](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L208)
329β
330## Accessors
331β
332### name
333β
334#### Get Signature
335β
336```ts
337get name(): TFieldName;
338```
339β
340Defined in: [FieldApi/FieldApi.public.ts:138](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi/FieldApi.public.ts#L138)
341β
342The name of the field.
343β
344##### Returns
345β
346`TFieldName`