Pagination
Links to the pages of a long list of results.
Our choice: No standard exists: a labelled <nav> with a list of links and aria-current="page", as for breadcrumbs.
Live example
Middle of a long list
<nav aria-label="Pagination" data-pagination>
<ul>
<li><a href="?page=4" rel="prev">Previous<span class="visually-hidden"> page</span></a></li>
<li><a href="?page=1"><span class="visually-hidden">Page </span>1</a></li>
<li aria-hidden="true">…</li>
<li><a href="?page=4"><span class="visually-hidden">Page </span>4</a></li>
<li><a href="?page=5" aria-current="page"><span class="visually-hidden">Page </span>5</a></li>
<li><a href="?page=6"><span class="visually-hidden">Page </span>6</a></li>
<li aria-hidden="true">…</li>
<li><a href="?page=10"><span class="visually-hidden">Page </span>10</a></li>
<li><a href="?page=6" rel="next">Next<span class="visually-hidden"> page</span></a></li>
</ul>
</nav>
First page
<nav aria-label="Pagination, search results" data-pagination>
<ul>
<li><a>Previous<span class="visually-hidden"> page</span></a></li>
<li><a href="?page=1" aria-current="page"><span class="visually-hidden">Page </span>1</a></li>
<li><a href="?page=2"><span class="visually-hidden">Page </span>2</a></li>
<li><a href="?page=3"><span class="visually-hidden">Page </span>3</a></li>
<li><a href="?page=2" rel="next">Next<span class="visually-hidden"> page</span></a></li>
</ul>
</nav>
Attributes
| Attribute or value | Where | Effect |
|---|---|---|
data-pagination | <nav aria-label="Pagination"> | |
aria-current="page" | the current page link (native ARIA) | |
<a> without href | a disabled Previous or Next (native placeholder link) | |
<li aria-hidden="true">…</li> | a gap in the page numbers |
Keyboard
| Key | Action |
|---|---|
| Tab | moves to the next page link / Shift+Tab: previous |
| Enter | follows the focused link |
Accessibility
- A visually hidden "Page" completes each number's link name (WCAG 2.4.4).
- At the ends, Previous or Next is an
<a>with nohref: not focusable. - Our choice: the current page stays a link with
aria-current="page", so the list count stays stable.
Specifications
- HTML
<nav>element - MDN
aria-current - WHATWG link type next
- WHATWG the a element
- WCAG Target size minimum
See also
How other systems do it
For comparison only; these are not the standard this system follows.
- Apple Human Interface Guidelines: No equivalent
- Material Design 3: No equivalent
- Vercel Geist: Pagination