# ConditionalFormatRule

Fields, allowed values, and APIs that use ConditionalFormatRule.

Canonical: https://grid.syidax.com/docs/types/ConditionalFormatRule/

<a id="definition"></a>

## Type definition

A question mark (?) marks an optional field; readonly marks a value you should not change directly. A union (|) accepts one of the listed forms. Functions are callbacks that Grid invokes at the relevant point.

```typescript
export interface ConditionalFormatRule {
  field?: string;
  condition: CfCondition;
  style: CfStyle;
  stopIfTrue?: boolean;
}
```

<a id="used-by"></a>

## APIs using this type

- [conditionalFormats](https://grid.syidax.com/docs/options/conditionalFormats.md) — Rules changing matching cells' visual properties, such as backgrounds and text. Does not mutate source values.
- [conditionalFormatsChanged](https://grid.syidax.com/docs/events/conditionalFormatsChanged.md) — Emitted when conditional formatting rules change. Save rules as user preferences.

<a id="parents"></a>

## Contracts containing this type

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

<a id="related"></a>

## Related types

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