Skip to main content
PimentCSS v1.0.1, what's new
Home

Pagination

Page controls, ellipsis, and compact table footers.

Styles live in scss/components/_pagination.scss. Pagination patterns for lists and tables: page links, jumpers, and arrow navigation.

Anatomy

PartClassRole
Bar.pagination<nav> with aria-label
Group.pagination__groupFlex row: arrows, jumper, or list
List.pagination__list<ul> of page buttons (jumper variant)
Item.pagination__item44×44px button; --prev / --next flip the arrow icon
Icon.pagination__item-icon24px arrow (aria-hidden when labeled)
Jumper.pagination__jumperPage field + .pagination__jumper-suffix
Results.pagination__resultsOptional select block (12px gap from group)
Select wrap.pagination__results-select-wrapChevron overlay (currentColor, theme-aware)

Prerequisites

  • PimentCSS installed, Installation.
  • Icons, arrows via ph() (Phosphor in this doc).
  • Screen reader text, use .sr-only for visually hidden labels on inputs.

Pagination item states

Matrix previews use static buttons. Doc-only .pagination__item--hover and .pagination__item--focus show states; production uses :hover and :focus-visible. Selected uses .pagination__item--selected and aria-current="page".

Default
Focus
Hover
Disabled
Next
Previous
Overflow
Numeric
Selected

Default (page jump)

Previous and next arrows flank a centered page field. Label the field with .sr-only or aria-label.

Jumper (numbered list)

Page numbers live in .pagination__list inside <li> elements. Wrap prev/next in list items for even spacing.

Interactive examples

Add data-pagination-live on .pagination and call wireAllPaginations() after load. Numbered lists update aria-current; the default jumper wires prev/next to the field.

With results per page

Optional block to the right of the group (12px gap). Pair with a labeled select.

Class reference

ClassDescription
.paginationNav container (flex, wrap, gap 8px)
.pagination__groupPrimary control cluster
.pagination__listHorizontal list of page buttons
.pagination__item44×44px control (action colors)
.pagination__item--prevFlips arrow icon (scaleX -1)
.pagination__item--nextArrow points right
.pagination__item--selectedCurrent page (filled action surface)
.pagination__item--hoverDoc-only hover preview
.pagination__item--focusDoc-only focus ring preview
.pagination__item-icon24px icon slot
.pagination__jumperField + suffix row
.pagination__jumper-fieldCentered numeric input
.pagination__jumper-suffixCaption (for example, of 20 pages)
.pagination__resultsResults-per-page row
.pagination__results-selectStyled select (text-filled value, options on surface-primary)
.pagination__results-select-wrapWrap for mask chevron (do not remove)

Customize (Sass)

  1. Pagination sizing

    Override item size, gaps, jumper width, and results select width.
    @use "pimentcss-design-system" with (
      $pagination-item-size: 2.75rem,
      $pagination-gap: 0.5rem,
      $pagination-jumper-width: 3rem,
      $pagination-results-select-width: 5rem
    );
  2. Rebuild CSS

    Run after editing _pagination.scss.
    npm run build:css

Accessibility (RGAA / WCAG)

Pagination pattern

  • Landmark, wrap controls in <nav aria-label="…">.
  • Current page, set aria-current="page" on the active page button (with .pagination__item--selected).
  • Icon buttons, prev/next and overflow need aria-label; hide icons with aria-hidden="true".
  • Numeric field, associate <label class="sr-only"> or aria-label on the jumper input.
  • Disabled, use the native disabled attribute on buttons at range ends.
  • Focus, visible :focus-visible ring on items and form controls.
  • Touch, items are 44×44px by default ($pagination-item-size).

Next steps