Open History to see the last commit
1---
2id: formOptions
3title: formOptions
4---
5β
6```ts
7const formOptions: FormOptionsApi<unknown>;
8```
9β
10Defined in: [utils.public.ts:373](https://github.com/TanStack/form/blob/main/packages/form-core/src/utils.public.ts#L373)
11β
12Keeps form data, validator, and submission types inferred when options are
13declared separately from a framework's form creation API.
14β
15The regular helper takes `defaultValues` at face value as the form data
16shape. For schema-driven inference, use `formOptions.strictSchema` when the
17schema defines an input-to-output boundary, or `formOptions.looseSchema` when
18the schema defines the shape but editable defaults may omit properties or
19need `null` or `undefined` values.
20β
21At runtime, this is an identity helper: it returns the original options
22object and does not create a form or run validation.
23β
24## Remarks
25β
26**Important:** Although this returns the original object unchanged at
27runtime, its type is normalized to `FormOptions`. Optional properties such
28as `validators` therefore remain optional even when supplied. This tradeoff
29enables safer inference and reuse.
30β
31## Example
32β
33```ts
34const profileOptions = formOptions({
35 defaultValues: { name: '' },
36 validators: [
37 {
38 triggers: ['change'],
39 run: ({ value }) =>
40 value.name.length === 0 ? 'Name is required' : undefined,
41 },
42 ],
43})
44β
45const form = useForm({
46 ...profileOptions,
47 onSubmit: ({ value }) => saveProfile(value),
48})
49```