Skip to main content
cngx-src documentation

RecyclerConfig

Interface

projects/common/data/recycler/recycler.ts

Import#

import { RecyclerConfig } from '@cngx/common/data'

Description#

Configuration for injectRecycler.

Index#

Instance Properties#

columns#number | unknown
Optional

Column count for grid mode. Phase 3 - ignored in Phase 1.

estimateSize#number | Signal | unknown

Estimated height per item (px). A fixed number, a Signal<number> for a reactive uniform estimate (e.g. an input() bound after construction), or a (index) => number for genuine per-index variable heights. Only the last form carries per-frame cost; a signal resolves to one uniform value.

layout#"list" | "grid"
Optional

Layout mode. 'list' (default) uses padding spacers. 'grid' is Phase 3 - passing it logs a dev-mode warning and falls back to 'list'.

overscan#number
Optional

Extra items to render above/below the viewport. Default: 5.

scrollDebounce#number
Optional

Debounce for scroll events in ms. Default: 16 (~1 frame).

scrollElement#ElementRef | HTMLElement | string

Scroll container. CSS selector, native element, or ElementRef.

serverTotal#function
Optional

Server-side total for A11y (aria-setsize) and "Showing X of Y" display. When not set, totalCount is used.

skeletonDelay#number
Optional

Delay before skeletons are shown (ms). Default: 0. E.g. 300 means showSkeleton only becomes true after 300ms - fast loads (< 300ms) never show a skeleton.

Optional

Async state source. When set, the recycler derives skeleton rendering, refresh state, and empty state from it - same convention as CngxCardGrid, CngxTreetable, CngxPopoverPanel, and CngxDialog.

totalCount#function

Total number of items. Reactive - changes on infinite scroll.

Important: For infinite scroll, this is the number of loaded items, not the server-side total. Otherwise the sentinel becomes unreachable.