Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

FormGroupValidator.md

161 lines3.7 KB

Defined in: validation.public.ts:918

Configures validation of a form group's value.

Extends

Type Parameters

TGroupValue

TGroupValue

Library-managed. Do not specify explicitly.

Properties

bailIfInvalid?

optional bailIfInvalid?: boolean;

Defined in: validation.public.ts:29

If true, skips this and subsequent validators when earlier validation has failed.

If false, earlier failures do not prevent this validator from running.

Default

false

Inherited from

Validator.bailIfInvalid


run

run: 
  | FormGroupValidatorFn<TGroupValue>
| StandardSchemaV1<TGroupValue, any>;

Defined in: validation.public.ts:21

The function or Standard Schema that validates the value in this validator's scope.

Inherited from

Validator.run


runOnMount?

optional runOnMount?: boolean;

Defined in: validation.public.ts:64

Whether this validator runs when the form is constructed or when its field or form group first mounts.

Default

false

Inherited from

Validator.runOnMount


skipOnSubmit?

optional skipOnSubmit?: 
  | boolean
| ValidationPredicateFn<TGroupValue, TGroupValue, "group">;

Defined in: validation.public.ts:56

Whether this validator runs during a submission attempt, independently of triggers.

Pass a boolean directly, or pass a function that returns true to skip it for the current attempt.

Default

false

Inherited from

Validator.skipOnSubmit


triggerDebounceMs?

optional triggerDebounceMs?: 
  | number
| ValidationDebounceFn<TGroupValue, TGroupValue, "group">;

Defined in: validation.public.ts:74

The delay in milliseconds before validation runs for change or blur events.

Pass a number for a fixed delay, or pass a function that returns the delay for the current event. Repeated events restart the delay. Submission validation runs immediately.

Default

0

Inherited from

Validator.triggerDebounceMs


triggers

triggers: ValidationTriggerOption<TGroupValue, TGroupValue, ConfigurableValidationTrigger, "group">[];

Defined in: validation.public.ts:82

Change and blur events that can run this validator, optionally with conditions.

An empty array disables change and blur validation. Configure submission separately with skipOnSubmit and initial validation with runOnMount.

Inherited from

Validator.triggers