Pager
Controls for moving through a list: one item at a time with the pager, or a group of items at a time with numbered pages.
The pager
This component group is for moving through items one at a time, such as a moderation queue or a run of submissions, where each item has its own screen and someone works through them in order. Our current usage is in the Admin Console but it is available in other contexts.
Note
Only use a pager when the user can focus on just one item at a time without needing context from others in the set.
Relevant code
<nav class="ds-pagination" aria-label="Queue navigation">
<span class="ds-pagination-position" aria-live="polite">Request 1 of 15</span>
<button class="ds-btn ds-btn-text" type="button" disabled><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg> <span class="ds-pagination-label">Previous</span></button>
<button class="ds-btn ds-btn-text" type="button"><span class="ds-pagination-label">Next</span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></button>
</nav>
- .ds-pagination
- A
<nav>with anaria-labelsaying which set it steps through. Holds the position, Previous and Next, in that order. - .ds-pagination-position
- The counter. Takes
aria-live="polite": without it a reader who cannot see the counter has no way to know that the Next they just pressed did anything. The wording is the host's to choose; the counter takes the slack before the buttons, so the buttons stay put as the number grows. - .ds-btn.ds-btn-text
- The two buttons, text-only, so they read as navigation rather than as actions. At either end of the set the button is
disabled, not removed: a control that vanishes changes the shape of the toolbar under the reader, and a disabled one says “there is nothing before this”, which is the actual information.
Above a table with group actions
| Select | Date | Title | Type |
|---|---|---|---|
| 2026-03-24 | Asymptotic Expansions of Schrödinger Operators | New | |
| 2025-07-09 | Symmetry Breaking in Non-Abelian Gauge Theories | Rep | |
| 2024-07-08 | Spectral Properties of Discrete Schrödinger Operators | Wdr |
Relevant code
<nav class="ds-pagination" aria-label="Moderation queue">
<span class="ds-pagination-position" aria-live="polite">Request 1–3 of 15</span>
<button class="ds-btn ds-btn-text" type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg> <span class="ds-pagination-label">Previous</span></button>
<button class="ds-btn ds-btn-text" type="button"><span class="ds-pagination-label">Next</span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></button>
</nav>
<div class="ds-card">
<form id="selection" method="post" action="…"></form>
<div class="ds-card-bar">
<div class="ds-btn-group">
<button class="ds-btn ds-btn-primary ds-btn-compact" type="submit" form="selection" name="action" value="approve">Approve</button>
<button class="ds-btn ds-btn-compact" type="submit" form="selection" name="action" value="hold">Hold</button>
<button class="ds-btn ds-btn-destructive ds-btn-compact" type="submit" form="selection" name="action" value="remove"><svg aria-hidden="true">…</svg> Remove selected</button>
<span class="ds-bulk-count" role="status" hidden>2 selected</span>
<button class="ds-btn ds-btn-text ds-btn-compact" type="reset" form="selection">Clear selection</button>
</div>
<form class="ds-form--compact" method="get" action="…" aria-label="Filter papers">
<label>Show <select class="ds-input" name="show">…</select></label>
<button class="ds-btn ds-btn-compact" type="submit">Apply</button>
</form>
</div>
<div class="ds-table-scroll" role="region" aria-label="Papers in this request" tabindex="0">
<table class="ds-table">…</table>
</div>
</div>
- .ds-pagination
- Steps through the requests. It sits above the card, because it changes everything in it: the table and its actions change together when the reader moves on.
- .ds-card-bar
- The header bar of the current request: the group actions and the selection count at its start, and a filter at its end. See Bulk actions.
- .ds-table
- The papers in the current request, with a checkbox per row. See Row selection.
Numbered pages
Numbered pages are for a long list split across pages, such as search results, where each page has its own address.
First page
Relevant code
<nav class="ds-pagination" aria-label="Search results pages">
<span class="ds-pagination-position">1–50 of 8,291 results</span>
<button type="button" class="ds-btn ds-btn-text" disabled><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg> <span class="ds-pagination-label">Previous</span></button>
<ol class="ds-pagination-pages">
<li><a href="?page=1" aria-current="page"><span class="is-sr-only">Page </span>1</a></li>
<li><a href="?page=2"><span class="is-sr-only">Page </span>2</a></li>
<li><a href="?page=3"><span class="is-sr-only">Page </span>3</a></li>
<li><a href="?page=4"><span class="is-sr-only">Page </span>4</a></li>
<li><a href="?page=5"><span class="is-sr-only">Page </span>5</a></li>
<li>…</li>
<li><a href="?page=166"><span class="is-sr-only">Page </span>166</a></li>
</ol>
<a class="ds-btn ds-btn-text" href="?page=2"><span class="ds-pagination-label">Next</span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a>
</nav>
- .ds-pagination
- A
<nav>with anaria-labelsaying which list it pages through. Holds the position, Previous, the page numbers and Next, in that order. - .ds-pagination-position
- Which items are on this page and how many there are in all, such as “1–50 of 8,291 results”.
- .ds-pagination-pages
- An
<ol>of links, one for each page shown. The current page takesaria-current="page". Each link includes the word “Page” in.is-sr-onlytext, so a screen reader says “Page 2” and not “2”. A gap in the numbers is a list item holding an ellipsis. On a narrow screen the page numbers are hidden, and the pager is one row: Previous, the position, Next. - a.ds-btn.ds-btn-text
- Previous and Next are links, because each page has its own address. At either end
of the list there is no page to go to, so that one is a
<button type="button" disabled>with the same classes: it keeps its place, and a screen reader skips it. - .ds-pagination-label
- The words Previous and Next, on every pager. On a narrow screen only the arrows show, and screen readers still read the words.
A middle page
Relevant code
<nav class="ds-pagination" aria-label="Search results pages">
<span class="ds-pagination-position">2,451–2,500 of 8,291 results</span>
<a class="ds-btn ds-btn-text" href="?page=49"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg> <span class="ds-pagination-label">Previous</span></a>
<ol class="ds-pagination-pages">
<li><a href="?page=1"><span class="is-sr-only">Page </span>1</a></li>
<li>…</li>
<li><a href="?page=49"><span class="is-sr-only">Page </span>49</a></li>
<li><a href="?page=50" aria-current="page"><span class="is-sr-only">Page </span>50</a></li>
<li><a href="?page=51"><span class="is-sr-only">Page </span>51</a></li>
<li>…</li>
<li><a href="?page=166"><span class="is-sr-only">Page </span>166</a></li>
</ol>
<a class="ds-btn ds-btn-text" href="?page=51"><span class="ds-pagination-label">Next</span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a>
</nav>
With filters, in a card
| Submission | Type | Status |
|---|---|---|
| submit/9620418 | New | On hold |
| submit/9617750 | Replacement | Announced |
| submit/9614203 | New | Announced |
Relevant code
<div class="ds-card">
<div class="ds-card-bar">
<form class="ds-form--compact" method="get" action="…" aria-label="Filters">
<label>Type <select class="ds-input" name="type">…</select></label>
<label>Status <select class="ds-input" name="status">…</select></label>
<label>Per page <select class="ds-input" name="size">…</select></label>
<button class="ds-btn ds-btn-compact" type="submit">Apply</button>
</form>
<p>1,669 submissions</p>
</div>
<div class="ds-table-scroll" …><table class="ds-table">…</table></div>
<nav class="ds-pagination" aria-label="Submission pages">
<span class="ds-pagination-position">26–50 of 1,669 submissions</span>
<a class="ds-btn ds-btn-text" href="?page=1"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg> <span class="ds-pagination-label">Previous</span></a>
<ol class="ds-pagination-pages">
<li><a href="?page=1"><span class="is-sr-only">Page </span>1</a></li>
<li><a href="?page=2" aria-current="page"><span class="is-sr-only">Page </span>2</a></li>
<li><a href="?page=3"><span class="is-sr-only">Page </span>3</a></li>
<li><a href="?page=4"><span class="is-sr-only">Page </span>4</a></li>
<li><a href="?page=5"><span class="is-sr-only">Page </span>5</a></li>
<li>…</li>
<li><a href="?page=67"><span class="is-sr-only">Page </span>67</a></li>
</ol>
<a class="ds-btn ds-btn-text" href="?page=3"><span class="ds-pagination-label">Next</span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a>
</nav>
</div>
- .ds-card-bar
- The filters, with results per page at the end of the row, and the total at the end of the bar. See Filters.
- .ds-pagination as the card's last row
- The pager, below the list only, edge to edge like the header bar: the position on the left, the page numbers on the right.
Above and below a list
- The first result
- The last result on this page
Relevant code
<nav class="ds-pagination ds-pagination--top" aria-label="Search results pages">
<span class="ds-pagination-position">1–50 of 8,291 results</span>
<button type="button" class="ds-btn ds-btn-text" disabled><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg> <span class="ds-pagination-label">Previous</span></button>
<ol class="ds-pagination-pages">
<li><a href="?page=1" aria-current="page"><span class="is-sr-only">Page </span>1</a></li>
<li><a href="?page=2"><span class="is-sr-only">Page </span>2</a></li>
<li><a href="?page=3"><span class="is-sr-only">Page </span>3</a></li>
<li><a href="?page=4"><span class="is-sr-only">Page </span>4</a></li>
<li><a href="?page=5"><span class="is-sr-only">Page </span>5</a></li>
<li>…</li>
<li><a href="?page=166"><span class="is-sr-only">Page </span>166</a></li>
</ol>
<a class="ds-btn ds-btn-text" href="?page=2"><span class="ds-pagination-label">Next</span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a>
</nav>
<ol class="demo-list">
<li>The first result</li>
<li>The last result on this page</li>
</ol>
<nav class="ds-pagination ds-pagination--bottom" aria-label="Search results pages, below the list">
<span class="ds-pagination-position">1–50 of 8,291 results</span>
<button type="button" class="ds-btn ds-btn-text" disabled><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg> <span class="ds-pagination-label">Previous</span></button>
<ol class="ds-pagination-pages">
<li><a href="?page=1" aria-current="page"><span class="is-sr-only">Page </span>1</a></li>
<li><a href="?page=2"><span class="is-sr-only">Page </span>2</a></li>
<li><a href="?page=3"><span class="is-sr-only">Page </span>3</a></li>
<li><a href="?page=4"><span class="is-sr-only">Page </span>4</a></li>
<li><a href="?page=5"><span class="is-sr-only">Page </span>5</a></li>
<li>…</li>
<li><a href="?page=166"><span class="is-sr-only">Page </span>166</a></li>
</ol>
<a class="ds-btn ds-btn-text" href="?page=2"><span class="ds-pagination-label">Next</span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a>
</nav>
- .ds-pagination--top
- A pager above a list, in a tinted bar.
- .ds-pagination--bottom
- A pager below a list, in a tinted bar. With the bar above, it bookends the list.
One page of results
Relevant code
<nav class="ds-pagination ds-pagination--top" aria-label="Search results pages">
<span class="ds-pagination-position">3 results</span>
</nav>
- .ds-pagination-position
- On its own when the whole list fits on one page: the count still shows, in its bar, and there are no controls and no pager below the list.
- Tinted bars bookend the list. Each bar keeps
--ds-space-8between itself and the list, the same space as between papers in a list. Inside a bar, the current page takes the page ground. - Which page numbers to show: the first page, the last page, and the current page with one page either side. On the first three pages, show pages 1 to 5; on the last three, the last five. An ellipsis stands for two or more pages; a gap of one page shows that page instead.
- A message about the whole list goes above the pager, such as a limit on how many results can be reached.
- Results per page and order are not in the pager. They go with the search or the filters that produced the list.
- In a card with a header bar, the pager is below the list only, as the card's last row. The header bar shows the total.
- On the page ground, above and below a long list; below a short one. A list of more than about 25 rows, such as search results, has the pager above and below it, so a reader at the end can go on without scrolling back up. A shorter list has the pager below it only.
- A pager that steps from one set to the next goes above the set's card, as in a moderation queue, because it changes everything in the card.
Accessibility essentials
- Name the set. The
<nav>takes anaria-labelthat says what it steps through, such as “Queue navigation”. - Announce the position. The counter is a polite live region, so each step is announced without moving focus.
- Disable the ends, do not remove them. Previous on the first item and Next on the last stay in place, disabled.
- Mark the current page. In numbered pages the link to the current page
takes
aria-current="page".