# CustomValidator (@salmonui/core/validation)

> The CustomValidator type of @salmonui/core/validation: 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/core/validation/CustomValidator

```ts
import type { CustomValidator } from '@salmonui/core/validation';
```

Entry index: https://salmonui.dev/docs/reference/core/validation (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/core/validation.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.
