# rowHeightFn

Calculates individual row heights from row indices and data. Call refreshRowHeights when relevant data changes.

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

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

## What does this API do?

Calculates individual row heights from row indices and data. Call refreshRowHeights when relevant data changes.

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

## Exact input and result types

```typescript
rowHeightFn: (index: number, row: GridData) => number
```

| Item | Value |
| --- | --- |
| JavaScript name | rowHeightFn |
| HTML attribute | row-height-fn |
| Default | undefined |
| Input type | (index: number, row: GridData) => number |

<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

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

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

## Feature explanations and examples

- [Large data sets](https://grid.syidax.com/docs/features/virtualization.md) — Virtualization renders only row and column DOM needed near the viewport. It is separate from row models that fetch only part of the data from a server.
