Components · Status and navigation

Pagination

Pagination here is a “load more” pattern: a counter, a thin progress bar and a button that adds more items to a list without a page load.

Every example on this page is the real component, not a picture. Figma: Pagination.

Playground

A list of reviews with the real component under it. Press the button to load 10 more items at a time (10, 20, then 22 of 22): the counter and the bar follow, and the button becomes disabled when everything is shown.

Markup for this selection

HTML

Overview

Pagination here is a “load more” pattern: a counter, a thin progress bar and one button that adds more items to a list without a page load. It tells the user how far through the list they are and gives one clear way to continue.

The component is narrow (190px) and centered, whatever the width of its section. It has one layout and no variants. The counter and the bar come from two numbers, the items shown and the total, so the total must be known up front.

This documentation has three pages. Examples & Guidelines (this page) shows when and how to use pagination. Specifications holds the values: tokens, spacing per breakpoint, measurements and requirements. Code shows how to add it to a list.


Usage

When to use

Use it at the end of a list that is too long to show at once. Use it to:

  • Load more reviews, products or orders into the same list
  • Show how much of the list is visible (the total count is known)
  • Keep the user on the page, in the same scroll position

When not to use

When everything is already shown

A counter that says “6 of 6” and a bar that is full has nothing left to offer. Keep the component and disable the button, so the user sees the list is complete.

Do disable the button when every item is shown.
Do not remove the button and leave the counter and the bar alone.

When the button is not Secondary

The action is supporting, not the main goal of the page. Keep the Secondary button at Medium size.

Do use the Secondary Medium button.
Do not use a Primary button: it competes with the main call to action.

Quick reference

The list…Use
is long, more items load on request and the total is knownPagination (load more)
is already fully shownPagination with a disabled button
needs numbered pages (1, 2, 3 …)A different pattern (not built yet)

Do

  • Place it last in the section or list.
  • Disable the button when all items are shown.
  • Compute the bar width from the numbers.
  • Use the Secondary Medium button.

Don’t

  • Add padding below the component.
  • Remove the button when all items are shown.
  • Stretch it to the section width.
  • Use a Primary button.

Anatomy

Pagination

  1. Counter. Shows how many items are visible and how many there are in all. Body-md, Surface 60, centered.
  2. Progress bar. A 2px track (Surface 10) with a fill (Surface 100). The fill width is visible ÷ total.
  3. Button. The eco-button Secondary, Medium, as wide as the component.

Variants

Pagination has no variants. It looks the same at every step of the list, only the numbers change. Three snapshots of the same component:

When every item is shown the counter and the bar are full and the button is disabled, see Behavior.


Sizes

Pagination has one size: 190px wide (max-width: 100%). The button inside is Medium: 40px high on mobile and tablet, 48px from 769px. All values are under Sizes in Specifications.


Layout & Appearance

Alignment

The component is centered in its section and never stretched to the section width, however wide the section is. Text is centered.

Placement

Place it as the last element of the section or list it belongs to. It has no bottom spacing of its own: the padding of the section below it gives the air. Adding padding or margin below it doubles the space.

Spacing above

The space above the component is page spacing, so it follows the five ECO breakpoints: 24px on mobile, 32px on tablet and 40px from 769px. It steps at 640px, while the component itself keeps mobile styling until 769px. The values are under Measurements in Specifications.

Appearance

Counter text in Surface 60, a Surface 10 track with a Surface 100 fill, and a Secondary button. Token names are under Design Tokens in Specifications.


Behavior

Load more

A click on the button adds the next items to the list and calls updatePagination(key, visible, total). The counter text and the bar fill update together. The fill animates its width with duration-medium-2 and ease-standard.

Items per click

One click loads 10 more items. The last click loads the rest: 10, 20, then 22 of 22.

All items shown

When visible reaches total, the script sets disabled on the button. The counter and the bar stay, full.

Breakpoints

Counter text and button follow mobile styling below 769px (sm looks like mobile). The space above steps at 640px and 769px.


Accessibility

All requirements are listed under Accessibility Requirements in Specifications.

Keyboard support

The button is a native <button>: Tab reaches it, Enter and Space load more. It has the eco-button focus ring.

Screen reader support

Mark the counter as a polite live region (aria-live="polite") so the new count is announced. The bar repeats the counter, so hide it from assistive technology with aria-hidden="true". A button that becomes disabled loses focus: move focus to the first new item first.



References