Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Learn to implement page based pagination with Next.js and Vercel.

Astro landing page starter with gradient background, responsive hamburger/dropdown menu, and switchable floating/fullscreen headers.
Pagination with SSG is a Next.js example template from Vercel that demonstrates page-based pagination using static site generation (SSG) and incremental static regeneration (ISR) to build fast, scalable product listing pages.
Pagination with SSG is a starter project published in Vercel's official examples repository that implements page-based pagination in Next.js. The template takes a dataset of products (the demo ships 100 test products in a single category) and generates a paginated product listing with 10 results per page, for a total of 10 pages. It runs on Next.js and is styled with Tailwind CSS, and it deploys directly to Vercel with a one-click clone. The core idea is to pre-render the first pages at build time and use ISR for the rest, keeping build times constant no matter how many pages exist.
getStaticPaths; the remaining pages are generated on first request with fallback 'blocking' and then cached with ISR.pnpm create next-app using the example URL, then run pnpm dev for development.getStaticPaths, getStaticProps, and fallback behavior for paginated routes.The template defines a dynamic route at pages/category/[page].tsx. In getStaticPaths, it returns five pre-generated paths (category/2 through category/6) and sets fallback to 'blocking'. At runtime, when a request comes for a path that wasn't pre-rendered, Next.js renders it on the server, caches the HTML and JSON, and serves it to future visitors. The index page handles category/1, completing the first six pages of static content.
The demo pre-renders six pages: the index page plus five generated paths from getStaticPaths, covering pages one through six. The remaining four pages (7-10) are generated on first visit and cached with ISR.
With blocking fallback, when a user requests a page that wasn't generated at build time, Next.js waits for the page to be rendered on the server before responding. That first request is slower, but the response is cached so subsequent visits are served from the edge cache.
Yes, the template is a starting point. You would replace the static array of 100 products with data from your CMS, database, or API, and adjust the per-page count to match your content.
The code snippet shown on the page is in TypeScript (a .tsx file), which is the default for Next.js examples. The repository itself is a standard Next.js example that works with JavaScript and TypeScript projects.
Pre-rendering every page would lengthen build times as content grows. By pre-rendering only the first pages and using ISR for the rest, the template keeps essential pages instantly available while ensuring overall build time stays constant.
