What this thread does
The case
You have a page that lists things (products, listings, posts) with filters such as category, price or search text, and the list keeps loading more results as the user scrolls. Success looks like: filters and sort live in the URL so a refresh, the Back button and a copied link all show the same results, new results load without a jump or duplicates, and the page shows a loading state while filters change. Stack: Next.js (App Router).
This is a map, not new advice: every row points to an existing WhatWorks thread. Nobody here ran this whole build; the Status column says what each linked thread rests on. "Tried" would need a linked trial report, and none of the linked threads has one yet.
Parts, in the order people do them
| Part | What to use | Status | Link |
|---|---|---|---|
| Filters, sort and page in the URL | searchParams prop on the page, useSearchParams or nuqs in client controls, Suspense | Documented: vendor or primary source, not tried (no linked trial) | How do I keep my Next.js list filters in the URL? |
| Infinite scroll or Load more | useInfiniteQuery with a cursor | Documented: vendor or primary source, not tried (no linked trial) | How do I add infinite scroll or Load more to a React list? |
| Pagination behind the list | Cursor (keyset) versus offset | Documented: vendor or primary source, not tried (no linked trial) | Cursor or offset pagination for my list endpoint: which one? |
| Server-side filtering and sorting in a table | tablecn starter (shadcn and TanStack) | Documented: vendor or primary source, not tried (no linked trial) | Which data table starter handles server-side filters and sorting? |
| Look while filters refetch | Keep old rows, show a pending state | Untried: community post or suggestion only, no linked trial | How should a data table look while it refetches new filters? |
| Loading and error screens | loading.js, error boundaries, skeletons | Documented: vendor or primary source, not tried (no linked trial) | How do I add loading skeletons and error pages in Next.js? |
| Restore scroll position on Back for a long list | No tested answer yet | No tested answer yet | none (see open request) |
Where it breaks
- Back button leaves the page or steps through every keystroke -> How do I keep my Next.js list filters in the URL?
- Duplicates or skipped items while scrolling -> Cursor or offset pagination for my list endpoint: which one?
- Table flashes empty when a filter changes -> How should a data table look while it refetches new filters?
- Scroll position lost on Back: No tested answer yet (see gap list)
Open questions
- Parts marked "No tested answer yet" are gaps in WhatWorks; ask for them with the request tool so an editor can look: restoring scroll position after Back on a long list.
Status key
Documented means the linked thread cites official docs or a vendor source and was not run. Untried means the linked thread rests on a community post or on suggestions and was not run. Tried would need a linked trial report, and none exists yet.
As of October 2026. a records table with export, see case-expense-table-nextjs-supabase-filters-sort-csv-export; KPI cards and charts, see case-kpi-dashboard-charts-postgres-scheduled-refresh.
Started from a post by @WhatWorks editors, packaged by the editor.