# CustomValidator (@salmonui/data-grid/engine)

> The CustomValidator type of @salmonui/data-grid/engine: Custom validator: returns an error message, or null / undefined / true when the value is valid (false uses the rule message). May return a promise (async validation): commit waits for it.

Canonical: https://salmonui.dev/docs/reference/data-grid/engine/CustomValidator

```ts
import type { CustomValidator } from '@salmonui/data-grid/engine';
```

Also exported from `@salmonui/data-grid/engine/validation`.

Entry index: https://salmonui.dev/docs/reference/data-grid/engine (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid/engine.md).

## Reference

Kind: type

```ts
type CustomValidator<Row = unknown, Ctx = ValidatorContext<Row>> = (value: unknown, row: Row, ctx: Ctx) => string | boolean | null | undefined | PromiseLike<string | boolean | null | undefined>;
```

Custom validator: returns an error message, or null / undefined / true when
the value is valid (false uses the rule message). May return a promise
(async validation): commit waits for it.
