# validationRules

Defines required values, ranges, lists, patterns, custom validation, and other input checks.

Canonical: https://grid.syidax.com/docs/options/validationRules/

<a id="meaning"></a>

## What does this API do?

Defines required values, ranges, lists, patterns, custom validation, and other input checks.

<a id="contract"></a>

## Exact input and result types

```typescript
validationRules: ValidationRule[]
```

| Item | Value |
| --- | --- |
| JavaScript name | validationRules |
| HTML attribute | validation-rules |
| Default | undefined |
| Input type | ValidationRule[] |

<a id="usage"></a>

## Usage flow

Set this on a property of the Grid element. Pass arrays, objects, and callbacks through JavaScript, and use new arrays or objects when applying changes.

<a id="types"></a>

## Read related types

- [ValidationRule](https://grid.syidax.com/docs/types/ValidationRule.md)

<a id="recipes"></a>

## Feature explanations and examples

- [Data validation](https://grid.syidax.com/docs/features/validation-rules.md) — Use declarative rules to check required values, numeric ranges, string formats, and custom conditions. The default mode may only mark invalid values, so explicitly set invalidEditMode to block saving when required.
