Skip to content

Pagination

Overview

The Pagination component provides navigation buttons and a page selector to help users navigate through large sets of content. Styles can be customised through CSS variables.

Example Usage

Basic Example

The basic Pagination component includes navigation buttons and a page selector.

First and Last Page Example

The ‘previous’ and ‘next’ buttons are removed for the first and last pages, respectively, for example:

CSS Variables

The following CSS variables are available for customizing the Pagination component:

VariableDefault ValueDescription
--pagination-select-padding-top0.5remTop padding for the page selector.
--pagination-select-padding-bottom0.5remBottom padding for the page selector.
--pagination-select-padding-left0.75remLeft padding for the page selector.
--pagination-select-padding-right2remRight padding for the page selector.
--pagination-select-border-width1pxBorder width for the page selector.
--pagination-select-border-width-disabled2pxBorder width for the disabled page selector.
--pagination-select-background-size1rem 1remBackground size for the dropdown arrow.
--pagination-select-background-positionright 0.5rem centerBackground position for the dropdown arrow.
--pagination-select-border-radiusvar(--radius-site)Border radius for the page selector.
--pagination-font-sizevar(--text-sm)Font size for pagination elements.
--pagination-font-weightvar(--font-weight-medium)Font weight for pagination elements.
--pagination-horizontal-gap1remHorizontal gap between pagination elements.
--pagination-select-svgurl("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");Downward chevron

Accessibility

Implemented Accessibility Features

  • Includes aria-label attributes for prev/next navigation buttons
  • Includes aria-label attributes for options
  • Provides visible focus indicators for keyboard navigation
  • Use of semantic HTML elements <nav> and <select>
  • Tab key navigates between pagination controls
  • Arrow keys change values in the select dropdown

Accessibility Considerations when implementing

  • ensure that aria-labels are dynamically updated with JavaScript
  • remove previous / next page buttons from the DOM when on the first and last page.