Pagination
Usage
Use pagination for long, stable lists people navigate by position: the work-order table, the vehicle register, audit logs. For feeds and activity streams use a "Show 20 more" button; for short lists show everything.
- Always show first and last page, the current page and its neighbours; collapse the rest into "…".
- Labels: "Previous" / "Next", "Page 3 of 12", "Rows per page", "Showing 21–40 of 312 work orders" — name the thing being counted.
- Keep the page in the URL (
?page=8) so links and the back button work.
Anatomy
- Landmark —
nav.pagination[aria-label]naming the list - Previous / Next —
.pagination__link--step(plain text when unavailable) - Page links —
a.pagination__linkwith hidden "Page " - Ellipsis —
.pagination__ellipsis - Current page —
aria-current="page": fill, border, bold - Table footer (optional) —
.pagination__barwith page size and range
Examples
States marked hover, focus-visible and active are frozen with .is-hover, .is-focus-visible, .is-active. Those classes share their rule with the real pseudo-class, so what you see is exactly what users get. Never use them in product code.
Pagination
First page: "Previous" is plain text, not a link.
Phones and narrow panels.
Data tables: page size, range and pages in one footer row. The range is a polite live region.
<nav class="pagination" aria-label="Pagination, work orders">
<ul class="pagination__list">
<li><a class="pagination__link pagination__link--step" href="?page=7" rel="prev">…Previous</a></li>
<li><a class="pagination__link" href="?page=1"><span class="sr-only">Page </span>1</a></li>
<li><span class="pagination__ellipsis">…</span></li>
<li><a class="pagination__link" href="?page=8" aria-current="page"><span class="sr-only">Page </span>8</a></li>
…
<li><a class="pagination__link pagination__link--step" href="?page=9" rel="next">Next…</a></li>
</ul>
</nav>
<!-- First page: Previous is not a link -->
<li><span class="pagination__link pagination__link--step" aria-disabled="true">…Previous</span></li>
API
| Hook | Values | Purpose |
|---|---|---|
.pagination | block class | <nav> |
.pagination--compact | modifier | Prev / "Page 3 of 12" / Next |
.pagination__list | __link | __link--step | __ellipsis | __icon | __status | parts | Pager |
.pagination__bar | __size | __select | __range | parts | Data-table footer |
aria-current="page" | attribute | Current page |
aria-disabled="true" on a span | attribute | Unavailable Previous / Next |
Do and don't
"Showing 21–40 of 312 work orders"
<a href="#" class="pagination__link" aria-disabled="true">Previous</a>
Accessibility
| Key | Behavior |
|---|---|
| Tab | Moves through the page links (unavailable Previous/Next are skipped) |
| Enter | Opens that page |
- Each
<nav>has a unique name ("Pagination, work orders") when several lists share a page. - Page links read "Page 8, current page" thanks to the hidden prefix and
aria-current. - After a page change, move focus to the table caption or heading and update the range text (
role="status"). - Targets are 40px; icon-only compact links have
aria-label. Arrow icons mirror in RTL.
Tokens
| Custom property | Purpose |
|---|---|
--size-control-md | Link size |
--color-selected-bg | -fg | -border | Current page |
--color-action-ghost-bg-hover | Hover |
--color-text-disabled | Unavailable step |
--input-bg | -border | -radius | Page-size select |
--color-text-muted | Ellipsis, range |