Skip to content
Data TableAPI Reference

Data loading and row height

comins-table@0.2.2React

Distinguishes incremental loading of a flat array from Viewport range loading. Callbacks request data; the application performs network requests and updates its state.

Viewport integration guide

loading?: boolean;

Default false. Initial loading presentation using loadingComponent or skeleton rows.

loadingComponent?: React.ReactNode;

Custom loading content; omission uses the built-in presentation.

emptyComponent?: React.ReactNode;

Custom empty-data content; omission uses the built-in presentation.

persistHeaderWhenEmpty?: boolean;

Default true. Keeps the header visible when empty.

skeletonRowCount?: number;

Defaults to min(max(1, pageSize), 5). Skeleton row count, not a data count.

loadingMore?: boolean;

Default false. Indicates an incremental request in progress and participates in duplicate-request prevention. Flat-array incremental loading only.

hasMoreRows?: boolean;

Default false. The parent indicates whether more data is available.

infiniteScroll?: boolean;

Default false. Flat-array mode calling onLoadMore near the bottom.

infiniteScrollThreshold?: number;

Default 160px. Remaining distance to the bottom used to trigger incremental loading.

onLoadMore?: () => void;

No-argument load-more notification. The parent appends rows and updates loadingMore/hasMoreRows.

lazyLoad?: boolean;

Default false. Append request mode with offset, limit, and signal. Use with onLazyLoad.

lazyLoadBatchSize?: number;

Default 30. Requested limit, normalized to an integer of at least 1.

lazyLoadMode?: "append";

The supported value and default is append. Use Viewport for arbitrary range loading.

lazyLoadThreshold?: number;

Defaults to infiniteScrollThreshold (normally 160px), normalized to a non-negative integer.

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?: boolean;

Default false for flat arrays. Viewport only permits true and always virtualizes. Provide a bounded scroll height.

"buffer-size"?: number;

Default 10 rows. Extra rendered rows around the virtual window, normalized to a non-negative integer.

rowHeight?: number;

Default 36px. Fixed row height and baseline for automatic sizing.

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?: number;

Estimate before auto-row measurement; falls back to rowHeight. A realistic estimate reduces scroll correction.

viewportDatasource: CominsViewportDatasource;

Required Viewport configuration containing revision and request/height-cache settings.

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?: true;

Only true is permitted in Viewport. There is no false mode rendering the entire remote dataset.

revision: CominsViewportRevision;

Required query identity matching the data revision. Change it together with a fresh snapshot for a new query.

maxConcurrentRequests?: number;

Maximum concurrent range requests, default 2.

heightCacheSize?: number;

Height-measurement block cache size, default 64. Separate from row-data cacheSize.

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.

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.

export type CominsViewportRange = {
startIndex: number;
endIndex: number;
};

Absolute index range, inclusive of startIndex and exclusive of endIndex.