Infinite Scroll

Load more rows as the user scrolls with onLoadMore.

Load more on scroll

Give the table a height so its body scrolls, then append rows in onLoadMore. Pair with isLoading so skeleton rows append under existing data.

React TSX
const [rows, setRows] = useState(initialRows);
const [isLoading, setIsLoading] = useState(false);
const handleLoadMore = async () => {
if (isLoading) return;
setIsLoading(true);
setRows((prev) => [...prev, ...(await fetchMore(prev.length))]);
setIsLoading(false);
};
<SimpleTable
columns={columns}
rows={rows}
height="400px"
onLoadMore={handleLoadMore}
isLoading={isLoading}
/>

Page / external scroll

Omit height / maxHeight and set scrollParent="window" (or a container / getter). The parent scroll drives virtualization and onLoadMore; the header sticks to the top of that viewport.

React TSX
<SimpleTable
columns={columns}
rows={rows}
scrollParent="window"
onLoadMore={handleLoadMore}
isLoading={isLoading}
/>

height vs scrollParent

If height or maxHeight is set, scrollParent is ignored. Without either, all rows render and onLoadMore does not fire.

Example

Scroll to the bottom to load more batches. Use Code or StackBlitz for the full example.

20 rows loaded

Props

Infinite Scroll Configuration

PropertyRequiredDescriptionExample
onLoadMore
() => void
Optional
Fires when the user scrolls near the bottom. Append the next batch of rows.
infiniteScrollThreshold
number
Optional
Pixels from the bottom at which onLoadMore fires. Defaults to 200.
height
string | number
Optional
Fixed table height for inner scrolling. Use this or scrollParent.
scrollParent
HTMLElement | "window" | (() => HTMLElement | null)
Optional
External scroll container when height/maxHeight are unset. Accepts an element, "window", or a getter.
isLoading
boolean
Optional
Appends skeleton rows under existing data while the next page loads.