FieldOptions

Interface: FieldOptions<TParentData, TName, TFieldValidator, TFormValidator, TData>

An object type representing the options for a field in a form.

Extended by

Type Parameters

TParentData

TName extends DeepKeys<TParentData>

TFieldValidator extends Validator<DeepValue<TParentData, TName>, unknown> | undefined = undefined

TFormValidator extends Validator<TParentData, unknown> | undefined = undefined

TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>

Properties

asyncAlways?

ts
optional asyncAlways: boolean;
optional asyncAlways: boolean;

If true, always run async validation, even if there are errors emitted during synchronous validation.

Defined in

packages/form-core/src/FieldApi.ts:346


asyncDebounceMs?

ts
optional asyncDebounceMs: number;
optional asyncDebounceMs: number;

The default time to debounce async validation if there is not a more specific debounce time passed.

Defined in

packages/form-core/src/FieldApi.ts:342


defaultMeta?

ts
optional defaultMeta: Partial<FieldMeta>;
optional defaultMeta: Partial<FieldMeta>;

An optional object with default metadata for the field.

Defined in

packages/form-core/src/FieldApi.ts:364


defaultValue?

ts
optional defaultValue: NoInfer<TData>;
optional defaultValue: NoInfer<TData>;

An optional default value for the field.

Defined in

packages/form-core/src/FieldApi.ts:338


listeners?

ts
optional listeners: FieldListeners<TParentData, TName, TFieldValidator, TFormValidator, TData>;
optional listeners: FieldListeners<TParentData, TName, TFieldValidator, TFormValidator, TData>;

A list of listeners which attach to the corresponding events

Defined in

packages/form-core/src/FieldApi.ts:368


name

ts
name: TName;
name: TName;

The field name. The type will be DeepKeys<TParentData> to ensure your name is a deep key of the parent dataset.

Defined in

packages/form-core/src/FieldApi.ts:334


validatorAdapter?

ts
optional validatorAdapter: TFieldValidator;
optional validatorAdapter: TFieldValidator;

A validator provided by an extension, like yupValidator from @tanstack/yup-form-adapter

Defined in

packages/form-core/src/FieldApi.ts:350


validators?

ts
optional validators: FieldValidators<TParentData, TName, TFieldValidator, TFormValidator, TData>;
optional validators: FieldValidators<TParentData, TName, TFieldValidator, TFormValidator, TData>;

A list of validators to pass to the field

Defined in

packages/form-core/src/FieldApi.ts:354

Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.