Skip to content

TbwScrollDetail

Detail payload for the tbw-scroll event.

Dispatched on the grid host whenever the vertical viewport scrolls (rAF-batched — at most one per frame). Use to trigger pagination, defer heavy cell content rendering, dismiss overlays, or sync a scroll-tracking UI outside the grid.

For server-side pagination of large datasets, prefer ServerSidePlugin which handles block fetching out of the box.

grid.addEventListener('tbw-scroll', (e) => {
const { scrollTop, scrollHeight, clientHeight } = e.detail;
if (scrollTop + clientHeight >= scrollHeight - 200) loadMore();
});
PropertyTypeDescription
scrollTopnumberCurrent vertical scroll offset in pixels (faux scrollbar).
scrollHeightnumberTotal scrollable height in pixels (faux scrollbar).
clientHeightnumberVisible viewport height in pixels (faux scrollbar).
directionvertical | horizontalAxis that triggered this dispatch. Currently always 'vertical'; 'horizontal' is reserved for a future opt-in dispatch and is declared up-front so consumer narrowing remains source-compatible.
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt