Data loading and row height
Distinguishes incremental loading of a flat array from Viewport range loading. Callbacks request data; the application performs network requests and updates its state.
Table props
Section titled “Table props”loading
Section titled “loading”loading?: boolean;Default false. Initial loading presentation using loadingComponent or skeleton rows.
loadingComponent
Section titled “loadingComponent”loadingComponent?: React.ReactNode;Custom loading content; omission uses the built-in presentation.
emptyComponent
Section titled “emptyComponent”emptyComponent?: React.ReactNode;Custom empty-data content; omission uses the built-in presentation.
persistHeaderWhenEmpty
Section titled “persistHeaderWhenEmpty”persistHeaderWhenEmpty?: boolean;Default true. Keeps the header visible when empty.
skeletonRowCount
Section titled “skeletonRowCount”skeletonRowCount?: number;Defaults to min(max(1, pageSize), 5). Skeleton row count, not a data count.
loadingMore
Section titled “loadingMore”loadingMore?: boolean;Default false. Indicates an incremental request in progress and participates in duplicate-request prevention. Flat-array incremental loading only.
hasMoreRows
Section titled “hasMoreRows”hasMoreRows?: boolean;Default false. The parent indicates whether more data is available.
infiniteScroll
Section titled “infiniteScroll”infiniteScroll?: boolean;Default false. Flat-array mode calling onLoadMore near the bottom.
infiniteScrollThreshold
Section titled “infiniteScrollThreshold”infiniteScrollThreshold?: number;Default 160px. Remaining distance to the bottom used to trigger incremental loading.
onLoadMore
Section titled “onLoadMore”onLoadMore?: () => void;No-argument load-more notification. The parent appends rows and updates loadingMore/hasMoreRows.
lazyLoad
Section titled “lazyLoad”lazyLoad?: boolean;Default false. Append request mode with offset, limit, and signal. Use with onLazyLoad.
lazyLoadBatchSize
Section titled “lazyLoadBatchSize”lazyLoadBatchSize?: number;Default 30. Requested limit, normalized to an integer of at least 1.
lazyLoadMode
Section titled “lazyLoadMode”lazyLoadMode?: "append";The supported value and default is append. Use Viewport for arbitrary range loading.
lazyLoadThreshold
Section titled “lazyLoadThreshold”lazyLoadThreshold?: number;Defaults to infiniteScrollThreshold (normally 160px), normalized to a non-negative integer.
onLazyLoad
Section titled “onLazyLoad”onLazyLoad?: (request: CominsLazyLoadRequest) => Promise<void> | void;Receives offset, limit, reason, and signal. Apply rows to parent data rather than returning them. Forward the cancellation signal.
virtualized
Section titled “virtualized”virtualized?: boolean;Default false for flat arrays. Viewport only permits true and always virtualizes. Provide a bounded scroll height.
buffer-size
Section titled “buffer-size”"buffer-size"?: number;Default 10 rows. Extra rendered rows around the virtual window, normalized to a non-negative integer.
rowHeight
Section titled “rowHeight”rowHeight?: number;Default 36px. Fixed row height and baseline for automatic sizing.
getRowHeight
Section titled “getRowHeight”getRowHeight?: (params: CominsRowHeightParams<TData>) => CominsRowHeight | undefined;Returns a number or auto per row; undefined falls back to rowHeight. params.row uses the event-row structure.
estimatedRowHeight
Section titled “estimatedRowHeight”estimatedRowHeight?: number;Estimate before auto-row measurement; falls back to rowHeight. A realistic estimate reduces scroll correction.
CominsViewportTableProps
Section titled “CominsViewportTableProps”viewportDatasource
Section titled “viewportDatasource”viewportDatasource: CominsViewportDatasource;Required Viewport configuration containing revision and request/height-cache settings.
onViewportRequest
Section titled “onViewportRequest”onViewportRequest: (request: CominsViewportRequest) => void | Promise<void>;Required range request with cancellation signal. Manual integrations must apply request/success/error/cancel to the snapshot; useCominsViewport provides matching tableProps.
virtualized
Section titled “virtualized”virtualized?: true;Only true is permitted in Viewport. There is no false mode rendering the entire remote dataset.
CominsViewportDatasource
Section titled “CominsViewportDatasource”revision
Section titled “revision”revision: CominsViewportRevision;Required query identity matching the data revision. Change it together with a fresh snapshot for a new query.
maxConcurrentRequests
Section titled “maxConcurrentRequests”maxConcurrentRequests?: number;Maximum concurrent range requests, default 2.
heightCacheSize
Section titled “heightCacheSize”heightCacheSize?: number;Height-measurement block cache size, default 64. Separate from row-data cacheSize.
CominsLazyLoadRequest
Section titled “CominsLazyLoadRequest”export type CominsLazyLoadRequest = { limit: number; offset: number; reason: CominsLazyLoadReason; signal: AbortSignal;};The complete public root request has startIndex, endIndex, revision, requestId, retainRange, and signal. retainRange: CominsViewportRange is the half-open range to retain. Do not import the internal CoreViewportRequest alias directly.
reason is initial/scroll/refresh. offset is the append start position; signal supports cancellation.
CominsViewportRequest
Section titled “CominsViewportRequest”export type CominsViewportRequest = CoreViewportRequest & { signal: AbortSignal;};The complete public root request has startIndex, endIndex, revision, requestId, retainRange, and signal. retainRange: CominsViewportRange is the half-open range to retain. Do not import the internal CoreViewportRequest alias directly.
Inherits startIndex/endIndex from CominsViewportRange. endIndex is exclusive. revision and requestId distinguish stale responses.
CominsViewportRange
Section titled “CominsViewportRange”export type CominsViewportRange = { startIndex: number; endIndex: number;};Absolute index range, inclusive of startIndex and exclusive of endIndex.