Filterable lists are among the most common features of modern web apps, whether for products in a shop, events in a calendar or members of an organization. In this article I show how to build a fast, filterable list with the Next.js App Router, React Server Components and Suspense, and explain the concepts behind the code.
What the post covers
- React Server Components: render on the server, ship less JavaScript and query the database directly without a separate API layer
- Suspense: handle loading states declaratively instead of managing
isLoadingflags by hand - Data model: a simple
Eventmodel with Prisma and PostgreSQL - Filtering via search params: the URL holds the filter state (e.g.
/events?status=open), so filters are shareable and bookmarkable - Client/server split: only the interactive filter UI is a client component, while data fetching stays on the server
- Suspense boundaries around the list, so switching filters doesn’t flash an empty UI
Takeaway
With the App Router, Server Components and Suspense, filterable lists can be fast (little client JS), simple (no extra API) and user-friendly (clean loading states). The same pattern works for product catalogs, travel bookings or member directories.
Read the full post on the MFG Blog of USTP → (in German)