Pagination UI splits a long list into numbered pages with Previous and Next links, the current page marked, and a few page numbers either side with ellipses for the gaps. Use it when people search for something specific, compare items or need to come back to the same place: search results, data tables, archives, admin lists. Use infinite scroll for feeds people browse without a goal, and a Load more button for product grids. Whatever you pick, give every page its own URL, make each page link a real link, mark the current page with aria-current="page", and wrap the whole thing in a labelled nav.
I'm a design engineer: I design products and build them in production code, so this covers both the layout and what the database and the HTML need to do. It's part of my product design work.
Pagination vs infinite scroll vs Load more
The choice follows what people are doing on the page.
| Pattern | Best for | Weak at |
|---|---|---|
| Pagination | Search results, data tables, archives, anything people return to | Casual browsing; each page is a click and a load |
| Load more | Product grids and category pages | Back button, unless you store position in the URL |
| Infinite scroll | Social feeds, news streams, image galleries | Finding one item, reaching the footer, comparing |
The research behind that table:
- Nielsen Norman Group, in Infinite Scrolling Is Not for Every Website (Hoa Loranger, 2014), says endless scrolling suits content that streams constantly with a flat structure, and "is not recommended for goal-oriented finding tasks". Pagination gives a clear end and lets people remember that something was "on page 3".
- Baymard Institute, in Christian Holst's usability study for Smashing Magazine (2016), found that people browsed far more products with infinite scroll or Load more than with pagination, that pagination felt slow, and that very few test subjects used the numbered links rather than Next and Previous. It recommends against infinite scroll for search results entirely.
So for e-commerce grids, Baymard's evidence favours Load more. For tables, search and admin lists, where people are looking for a specific row and need to come back to it, I use pagination almost every time.
Anatomy of a pagination control
From left to right, a full control holds:
- Previous. A link with a visible label or an accessible name such as "Previous page". Hidden or disabled on page 1.
- First page. Page 1, always shown, so people can get back to the start.
- Ellipsis. A gap marker, not a link, when pages are skipped.
- Neighbours. One or two pages either side of the current one.
- Current page. Visually distinct by more than colour (a border, weight or filled shape) and marked in code.
- Last page. Shown when the total is known.
- Next. The most used control, so the largest target.
Around it, on data-heavy screens: a results count ("Showing 51 to 100 of 1,240"), a page size picker and, for very long sets, a "Go to page" field. A typical sequence reads ‹ 1 … 4 5 [6] 7 8 … 25 ›. Keep the control the same width as the current page changes, so Next doesn't jump under the pointer.
Calendars and step-by-step flows don't need numbers at all: Previous, Next and "Today" or a step label do the job.
Choosing the page size
There's no single right number, but there is evidence for some contexts. Baymard's study suggests, for e-commerce:
- Category pages: load 10 to 30 products at first, more for visual products and fewer for spec-heavy ones, with Load more after 50 to 100.
- Search results: 25 to 75 by default.
- Mobile: 15 to 30 before a Load more button.
For data tables, I start at 25 or 50 rows and let people choose a larger page size, then remember their choice. The real test is the job: an ops lead scanning today's orders wants enough rows to see the whole day without clicking; someone checking one record will search instead. A good search and filter bar does more for long lists than any page size.
URL state and SEO
Pagination is also how search engines find everything past page one. Google's guidance, Pagination, incremental page loading, and their impact on Google Search, sets the rules:
- Give each page a unique URL, for example
?page=3. - Link pages with
<a href>. Google's crawlers generally follow links inhrefattributes and don't click buttons, so a Load more button or infinite scroll needs real paginated URLs behind it, or a sitemap. - Don't use fragments. Google ignores what follows
#, so#page=3won't be crawled. - Don't canonicalise every page to page 1. Each page gets its own canonical URL.
rel="next"andrel="prev"are no longer used by Google, though the page notes other search engines may still use them.- Keep filter and sort variations out of the index with
noindexor robots.txt where they only create duplicates.
The same URL state helps people too. Put page, page size, sort and filters in the query string, so a shared link or a refresh lands on the same rows. For Load more, Baymard recommends updating the URL as more items load (the `history.pushState()` method), so the back button returns people to where they were.
Data tables and cursor pagination
The obvious query, LIMIT 50 OFFSET 5000, gets slower as people go deeper. PostgreSQL's documentation is direct about it: "The rows skipped by an OFFSET clause still have to be computed inside the server; therefore a large OFFSET might be inefficient." It also warns that without an ORDER BY that gives a unique order, different pages can return inconsistent rows. Add a tie-breaker, usually the id.
Cursor (or keyset) pagination, which Markus Winand explains in No Offset, asks for "the next 50 rows after this one" instead:
SELECT id, created_at, customer, total
FROM orders
WHERE (created_at, id) < ($1, $2) -- the last row of the current page
ORDER BY created_at DESC, id DESC
LIMIT 50;It stays fast at any depth and doesn't skip or repeat rows when new ones arrive. The design consequence: you can't jump to page 37, because there is no page 37, only "after this row". So a cursor-paged table gets Previous and Next, a results count if you can afford it, and good search and filters for finding something specific. I decide this with whoever owns the backend before I draw the control, because offset and cursor pagination need different interfaces.
Two more table rules: keep the column header and the pagination control in view together on long pages, and preserve selected rows across pages, or say clearly that selection is per page.
Accessibility
Pagination is navigation, and it should be marked up as such:
- A labelled
nav. Wrap the control in<nav aria-label="Pagination">, so screen reader users can find it among the page's landmarks and tell it apart from the main menu. - A list of links.
<ul>and<li>let screen readers announce how many items there are. Use links, not buttons, when each page has a URL. aria-current="page"on the current page's link. MDN's aria-current reference describes thepagevalue for exactly this: the current page within a set of pages.- Names that make sense alone. "Page 6" rather than "6", and "Next page" for an arrow icon.
- Target size. WCAG 2.2 success criterion 2.5.8 (Level AA) asks for targets of at least 24 by 24 CSS pixels, or enough spacing around smaller ones. Numbered links in small type often fail it.
- Focus after a page change. On a full page load, focus starts at the top as usual. If the list updates without a reload, move focus to the list's heading or the results count, and say what changed, for example "Page 6 of 25".
Pagination on mobile
Phones don't have room for seven numbers. I show Previous, "Page 6 of 25" and Next, with the "of 25" doubling as a way to jump if tapped. Baymard's study found page links hard to tap on mobile, which is one reason Load more often wins on small screens for product lists. For tables on mobile, switching rows to stacked cards and using Load more is usually kinder than tiny page numbers.
A pagination component in code
Here's the markup I aim for, then a small helper for the page range.
<nav aria-label="Pagination">
<ul class="pagination">
<li><a href="?page=5" rel="prev">Previous<span class="sr-only"> page</span></a></li>
<li><a href="?page=1" aria-label="Page 1">1</a></li>
<li aria-hidden="true">…</li>
<li><a href="?page=5" aria-label="Page 5">5</a></li>
<li><a href="?page=6" aria-label="Page 6" aria-current="page">6</a></li>
<li><a href="?page=7" aria-label="Page 7">7</a></li>
<li aria-hidden="true">…</li>
<li><a href="?page=25" aria-label="Page 25">25</a></li>
<li><a href="?page=7" rel="next">Next<span class="sr-only"> page</span></a></li>
</ul>
</nav>// Returns e.g. [1, 'gap', 5, 6, 7, 'gap', 25]
export function pageRange(current: number, total: number, around = 1) {
const pages: (number | 'gap')[] = [];
for (let p = 1; p <= total; p++) {
if (p === 1 || p === total || Math.abs(p - current) <= around) pages.push(p);
else if (pages.at(-1) !== 'gap') pages.push('gap');
}
return pages;
}Keeping rel="prev" and rel="next" costs nothing and may still help other search engines. If you build on shadcn/ui, its Pagination component renders a nav with aria-label="pagination" and puts aria-current="page" on the link you mark isActive, which I confirmed in its source on 10 November 2026. Its examples use href="#", so swap in real URLs.
Frequently asked questions
Is pagination better than infinite scroll?
For finding, comparing and returning to items, yes: search results, tables and archives. For browsing a feed without a goal, infinite scroll works better. For product grids, Baymard's research favours a Load more button.
How many items should be on each page?
It depends on the content. Baymard's e-commerce research suggests 25 to 75 for search results and 10 to 30 to start on category pages. For data tables I start at 25 or 50 rows and let people pick more.
Is pagination bad for SEO?
No, if each page has its own URL and is linked with a normal <a href>. Google says not to canonicalise every page to page 1 and not to use # fragments for page numbers.
Does Google still use rel="next" and rel="prev"?
No. Google's pagination guidance says it no longer uses them, though other search engines may.
How do I make pagination accessible?
Wrap it in a nav with an aria-label, list the links in a ul, mark the current page with aria-current="page", give arrow icons text names and keep every target at least 24 by 24 CSS pixels.
Can you design and build the lists and tables in my product?
Yes. I design tables, filters and pagination in Figma and build them in TypeScript, React and Next.js, including the query and URL state behind them. See my product design work.
Sources and method
I searched the keyword on 10 November 2026 and read the top results: design-focused guides with examples, but little on Google's current rules, aria-current, cursor pagination or code. I read every source below on 10 November 2026.
- Nielsen Norman Group, Infinite Scrolling Is Not for Every Website (Hoa Loranger, 2014), checked 10 November 2026: nngroup.com
- Christian Holst, Baymard Institute, Infinite Scrolling, Pagination Or "Load More" Buttons? Usability Findings In eCommerce, Smashing Magazine (2016), checked 10 November 2026: smashingmagazine.com
- Google Search Central, Pagination, incremental page loading, and their impact on Google Search, checked 10 November 2026: developers.google.com
- PostgreSQL documentation, LIMIT and OFFSET, checked 10 November 2026: postgresql.org
- Markus Winand, Use The Index, Luke: No Offset, checked 10 November 2026: use-the-index-luke.com
- MDN, aria-current, checked 10 November 2026: developer.mozilla.org
- MDN, History.pushState(), checked 10 November 2026: developer.mozilla.org
- W3C, Understanding SC 2.5.8 Target Size (Minimum) (WCAG 2.2), checked 10 November 2026: w3.org
- shadcn/ui, Pagination documentation and source, checked 10 November 2026: ui.shadcn.com
If you're designing a product with long lists and tables and want them designed and built as one system, book a free 30 minute intro call. After it, you get a written scope and one fixed quote.
Tags: Pagination, Data tables, Accessibility, SEO, Product design



