# viewportDatasource

Viewport model supplying data for visible row ranges. Implement initialization, range changes, and cleanup.

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

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

## What does this API do?

Viewport model supplying data for visible row ranges. Implement initialization, range changes, and cleanup.

API for Pro features: Viewport row model

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

## Exact input and result types

```typescript
viewportDatasource: ViewportDatasource<GridRow>
```

| Item | Value |
| --- | --- |
| JavaScript name | viewportDatasource |
| HTML attribute | viewport-datasource |
| Default | undefined |
| Input type | ViewportDatasource<GridRow> |

<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

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

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

## Feature explanations and examples

- [Stream the visible range](https://grid.syidax.com/docs/features/viewport-row-model.md) — This suits price feeds and monitoring views where the total count is known but only visible rows need continuous updates. Adjusting the subscription to the scroll range is essential.
