# cellClassRules

Rules for applying CSS classes conditionally.

Canonical: https://grid.syidax.com/docs/columns/cellClassRules/

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

## What does this API do?

Rules for applying CSS classes conditionally.

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

## Exact input and result types

```typescript
cellClassRules?: Record<
    string,
    GridCallback<[CellCallbackParams<TData, TValue, TContext>], boolean> | string
  >
```

| Item | Value |
| --- | --- |
| Required | Optional |
| Input type | Record<<br>    string,<br>    GridCallback<[CellCallbackParams<TData, TValue, TContext>], boolean> \| string<br>  > |

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

## Usage flow

Set this on an individual column object in columnDefs. Pass arrays, objects, and callbacks through JavaScript, and use new arrays or objects when applying changes.

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

## Read related types

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

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

## Feature explanations and examples

- [Customize cell appearance](https://grid.syidax.com/docs/features/custom-cells.md) — Cell renderers change how data is displayed. Use them for status badges, links, and action buttons while retaining the original values for sorting and filtering.
