Skip to main content Home
About About the Design SystemRoadmap
Get started OverviewDesignersDevelopers
Foundations OverviewColorGridIconographySpacingTypography
Tokens Overview Global colorbox shadowTypographyborderopacityspacelengthIconBreakpointsMedia Queries
Elements All elements Accordion Alert Announcement Audio player Avatar Back to top Badge Blockquote Breadcrumb Button Card Chip Code block Call to action Dialog Disclosure Footer Health index Icon Jump links Navigation (primary) Navigation (secondary) Pagination PopoverPlanned Progress stepsPlanned Site status Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed
Theming OverviewColor PalettesCustomizingDevelopers
Patterns All PatternsCardTabsFilterFormLinkLink with iconLogo wallSearch barSkip navigationSticky bannerSticky cardTileVideo thumbnail
Personalization All Personalization PatternsAnnouncement
Accessibility FundamentalsAccessibility toolsAssistive technologiesCI/CDContentContributorsDesignDevelopmentManual testingResourcesScreen readers
Design/code status Release notes Get support

Pagination

OverviewStyleGuidelinesCodeAccessibilityDemos
ImportingUsagerh-paginationImportingUsagerh-pagination

Importing

Add rh-pagination to your page with this import statement:

<script type="module">
  import '@rhds/elements/rh-pagination/rh-pagination.js';
</script>
Copy to Clipboard Wrap lines

To learn more about installing RHDS elements on your site using an import map read our getting started docs.

Lightdom CSS

This element requires you to load "Lightdom CSS" stylesheets for styling deeply slotted elements.

Note

Replace /path/to/ with path to the CSS file, whether local or CDN.

<link rel="stylesheet" href="/path/to/rh-pagination/rh-pagination-lightdom.css">

Usage

<rh-pagination>
  <ol>
    <li><a href="#">1</a></li>
    <li><a href="#2">2</a></li>
    <li><a href="#3">3</a></li>
    <li><a href="#4">4</a></li>
    <li><a href="#5">5</a></li>
  </ol>
</rh-pagination>

<link rel="stylesheet" href="../rh-pagination-lightdom.css">

<script type="module">
  import '@rhds/elements/rh-pagination/rh-pagination.js';
</script>
Copy to Clipboard Wrap lines

rh-pagination

A paginator allows users to navigate between pages of related content.

Slots 3
Slot Name Description

An ordered list of links

go-to-page

"Go to page" text, defaults to "Page"

out-of

"of" text

Attributes 8
Attribute DOM Property Description Type Default
overflow overflow

Override overflow values set from HTML or JS. overflow should ideally be private, but because we can't do ::slotted(nav ol li), we need to reflect it to a host attribute, so that lightdom CSS can target the list items.

'start' | 'end' | 'both' | null
null
label label

Accessible label for the 'nav' element

string
'Page navigation'
label-first labelFirst

Accessible label for the 'first page' button

string
'first page'
label-previous labelPrevious

Accessible label for the 'previous page' button

string
'previous page'
label-next labelNext

Accessible label for the 'next page' button

string
'next page'
label-last labelLast

Accessible label for the 'last page' button

string
'last page'
size size

Change pagination size to small

'sm' | null
null
variant variant

"Open" variant

'open' | null | undefined
null
Methods 5
Method Name Description
first()

Navigate to the first page

prev()

Navigate to the previous page

next()

Navigate to the next page

last()

Navigate to the last page

go(page: 'first' | 'prev' | 'next' | 'last' | number)

Navigate to a specific page

Events 0
None
CSS Shadow Parts 4
Part Name Description
container

pagination container

numeric-middle

container for the numeric control at medium screen widths

numeric-end

container for the numeric control at small and large screen widths

numeric

shared container for the numeric controls at all widths

CSS Custom Properties 3
CSS Property Description Default
--rh-pagination-accent-color

Sets the outline color when the page input has focus.

var(--rh-color-interactive-blue, #0066cc)
--rh-pagination-background-focused

Sets the disabled stepper color.

var(--rh-color-gray-20, #c7c7c7)
--rh-pagination-stepper-color

Sets the stepper color.

var(--rh-color-icon-subtle, #707070)
Design Tokens 37
Token Copy
--rh-border-radius-default
Full CSS Variable Permalink to this token
--rh-border-width-lg
Full CSS Variable Permalink to this token
--rh-border-width-md
Full CSS Variable Permalink to this token
--rh-border-width-sm
Full CSS Variable Permalink to this token
--rh-color-border-interactive
Full CSS Variable Permalink to this token
--rh-color-border-subtle
Full CSS Variable Permalink to this token
--rh-color-border-subtle-on-light
Full CSS Variable Permalink to this token
--rh-color-gray-30
Full CSS Variable Permalink to this token
--rh-color-gray-40
Full CSS Variable Permalink to this token
--rh-color-gray-50
Full CSS Variable Permalink to this token
--rh-color-gray-60
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-default
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-hover
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-visited-default
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-visited-hover
Full CSS Variable Permalink to this token
--rh-color-red-40
Full CSS Variable Permalink to this token
--rh-color-red-60
Full CSS Variable Permalink to this token
--rh-color-surface-dark
Full CSS Variable Permalink to this token
--rh-color-surface-darkest
Full CSS Variable Permalink to this token
--rh-color-surface-lighter
Full CSS Variable Permalink to this token
--rh-color-surface-lightest
Full CSS Variable Permalink to this token
--rh-color-text-primary
Full CSS Variable Permalink to this token
--rh-color-text-primary-on-dark
Full CSS Variable Permalink to this token
--rh-color-text-secondary-on-dark
Full CSS Variable Permalink to this token
--rh-font-family-heading
Full CSS Variable Permalink to this token
--rh-font-size-body-text-lg
Full CSS Variable Permalink to this token
--rh-font-size-body-text-md
Full CSS Variable Permalink to this token
--rh-font-size-body-text-xl
Full CSS Variable Permalink to this token
--rh-font-size-heading-xs
Full CSS Variable Permalink to this token
--rh-length-2xl
Full CSS Variable Permalink to this token
--rh-length-3xl
Full CSS Variable Permalink to this token
--rh-length-4xl
Full CSS Variable Permalink to this token
--rh-space-2xl
Full CSS Variable Permalink to this token
--rh-space-lg
Full CSS Variable Permalink to this token
--rh-space-md
Full CSS Variable Permalink to this token
--rh-space-sm
Full CSS Variable Permalink to this token
--rh-space-xs
Full CSS Variable Permalink to this token
© 2021-2025 Red Hat, Inc. Deploys by Netlify