Navigation

Pagination

Links between the pages of a long list, with the current page highlighted.

Class nameTypeDescription
paginationplf:paginationComponentThe pagination landmark
pagination-listplf:pagination-listPartThe list of controls
pagination-linkplf:pagination-linkPartA page, Previous or Next link
pagination-textplf:pagination-textPartA control's text label
pagination-ellipsisplf:pagination-ellipsisPartSkipped pages
pagination-iconplf:pagination-iconPartAn SVG icon in a control; an icon class there doesn't need it
pagination-previousplf:pagination-previousModifierDraws a back chevron
pagination-nextplf:pagination-nextModifierDraws a forward chevron

Keep role="list", since WebKit stops announcing a list without markers, and name each page link with aria-label, such as “Page 3”. The current page is a <span aria-current="page">, and an unavailable control a <span aria-disabled="true">.

With icons

Without a text label, pagination-previous and pagination-next show their chevron alone, which flips in right-to-left layouts; an icon of yours goes in a pagination-link without those classes.

React

Pagination from @pelatform/react renders the nav and its list around its items; a router’s Link takes the classes and attributes of the HTML tab, such as pagination-link.

Prop Values Default
aria-label The navigation’s name Pages
current On PaginationLink, true for the current page: a <span aria-current="page"> without the link’s href and aria-label false
disabled On PaginationPrevious and PaginationNext, true on the first or last page: a <span aria-disabled="true"> in the link’s place false

The parts:

Part Element
PaginationItem An li
PaginationLink An a with pagination-link
PaginationPrevious An a with pagination-link and pagination-previous, named Previous page and labeled Previous unless given others
PaginationNext An a with pagination-link and pagination-next, named Next page and labeled Next unless given others
PaginationEllipsis A span with pagination-ellipsis, read as Skipped pages unless given other children

Other props are the element’s own, className and ref included.

CSS variables

Pagination has no JavaScript: your application builds the URLs and marks the current page. Override these variables on a root or on a single pagination.

Variable Default
--plf-pagination-color Text color
--plf-pagination-bg, --plf-pagination-border Transparent
--plf-pagination-hover-bg Muted surface; a custom --plf-pagination-bg stays on hover unless this is set
--plf-pagination-current-bg --plf-color-primary-subtle
--plf-pagination-current-color --plf-color-primary-text
--plf-pagination-current-border --plf-color-primary-border
--plf-pagination-height Small control height (32px), also the minimum width
--plf-pagination-radius Large radius (8px)
--plf-pagination-gap Space 1 (4px)
--plf-pagination-icon-size Control icon size (16px)

Built with Pelatform UIv0.1.0

Components

Getting started

Foundations

Components

Actions

Data display

Navigation

Feedback

Data input

Layout

Advanced

Integrations

Blocks

Application

Authentication

Icons