Server-Side Pagination in Ant Design Table: Doing It Right
Client-side pagination in Ant Design Table collapses under large datasets. Here's how to wire the pagination, onChange, and loading props to your API so the server does the slicing.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Client-side pagination in Ant Design Table collapses under large datasets. Here's how to wire the pagination, onChange, and loading props to your API so the server does the slicing.
Learn how to drive Ant Design Table pagination, sorting, and filtering entirely from the server using a controlled pagination object and the unified onChange callback. Includes a minimal React example, common pitfalls, and a verification checklist.
Learn how to offload pagination, sorting, and filtering to the backend using Angular Material’s MatTable backed by a custom CDK DataSource, reducing initial payload and keeping change detection lean.
Problem Context The Ant Design v5 Table component supports virtual scrolling via scroll={{ y: 300 }} . The documentation explicitly states that a rowHeight must be provided for the virtual scroll algorithm to calculate offsets correctly. When omitted, the component defaults to 48 px, which can be significantly different from the actual height of rows that co
Server-side pagination with Ant Design Table requires careful state management when the total record count changes during filtered queries. The Table component in version 5.x supports server-side pagination through a configuration object passed to the pagination prop. This setup expects the parent component to manage current page state and pageSize, triggeri
Context PrimeNG's p-table component supports lazy loading through the [lazy] input and (onLazyLoad) event emitter. When enabled, the component delegates data fetching to the application, passing a LazyLoadEvent object containing first (offset) and rows (page size) values. The integrated p-paginator updates these values automatically on user interaction. Unre
In Ant Design Table, the rowKey prop is mandatory for stable rendering. The default key is the string 'key' , so data objects without a key property cause React to reuse the same key for every row. This silent failure generates duplicate key warnings, unstable row ordering, and can expose sensitive identifiers if the key is derived from a private field. The