# computeScrollMapping

> _Since v2.13.0_

Compute a mapping between the spacer's native scrollTop and the virtual
row-content scroll offset.

For datasets within `maxSpacerHeight`, mapping is identity (no transform).
Above the cap, the spacer is clamped and `scrollTop` units no longer equal
row-content units — call toVirtualScrollTop / fromVirtualScrollTop
to translate between the two coordinate spaces.

```ts
function computeScrollMapping(rawContentHeight: number, viewportHeight: number, maxSpacerHeight: number): ScrollMapping
```

## Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| `rawContentHeight` | <code>number</code> |  |
| `viewportHeight` | <code>number</code> |  |
| `maxSpacerHeight` | <code>number</code> |  |
