# FieldValidator

Source: /tuil/docs/reference/packages/form/api/field-validator
Locale: en

type exported by @mwillbanks/tuil-form.



{/* Generated by tooling/docs/generate-reference.ts. */}

## type [#type]

Public type exported by `@mwillbanks/tuil-form`.

```ts
export type FieldValidator<T> = (
  value: T,
  context: ValidationContext,
) => string | undefined | Promise<string | undefined>;
```

## Members [#members]

This declaration has no public members.

## Parameters [#parameters]

This declaration has no public members.

## Returns [#returns]

This declaration does not return a value.

## Throws [#throws]

No thrown errors are documented for this declaration.

## Related types [#related-types]

* [`ValidationContext`](/tuil/docs/reference/packages/form/api/validation-context)

## Source [#source]

[View the secondary source reference](https://github.com/mwillbanks/tuil/blob/main/packages/form/src/index.tsx)

## Package [#package]

[@mwillbanks/tuil-form](/tuil/docs/reference/packages/form)
