Skip to content

Pagination

BetaData displayOpen in the workshop

Moves through pages of a table or list; collapses long ranges with an ellipsis.

nav > ul.xg-pagination > li > button[aria-current="page"] · span.is-gap

Example and markup

Live, from xg-ui.css and xg-ui.js. Switch the brand and mode on the example itself, or for the whole site in the header.

Pagination
Markup
<nav aria-label="Pages">
<ul class="xg-pagination">
<li>
<button type="button" aria-label="Previous page">‹</button>
</li>
<li>
<button type="button">1</button>
</li>
<li>
<span class="is-gap" aria-hidden="true">…</span>
</li>
<li>
<button type="button">4</button>
</li>
<li>
<button type="button" aria-current="page">5</button>
</li>
<li>
<button type="button">6</button>
</li>
<li>
<span class="is-gap" aria-hidden="true">…</span>
</li>
<li>
<button type="button">50</button>
</li>
<li>
<button type="button" aria-label="Next page">›</button>
</li>
</ul>
</nav>

States

Hover, focus and pressed are forced here with .is-hover, .is-focus and .is-active so they can be seen side by side; in a product they come from :hover, :focus-visible and :active.

Pagination: every state
StatePage button
Default
Hover
Focus
Current
Disabled

When to use it

Use it for

tables and lists longer than one page.

Not for

feeds where infinite scroll or “Load more” is expected.

Rules

  • Previous and Next are always present and disabled at the ends.
  • Show first, last, current ±1, and an ellipsis between.
  • Pair with a range text: “26–50 of 1,240”.

Accessibility

  • <nav aria-label="Table pages">; the current page has aria-current="page"; arrows have aria-labels.

Every color pair this component uses is measured for both brands in light and dark on the Accessibility page.

Also in Data display: Data table, KPI card, Status badge, Tag, Avatar, Progress, Chart, Tooltip, Empty state, Skeleton, Spinner. Used in the patterns Dashboard, Reporting table.

Status Beta: usable; class names may still change in a minor release, with a note (see Releasing).