Pagination
On this page
Overview
Enables navigation across pages of content using first/prev/next/last
stepper buttons, numbered page links, and a direct page-input field.
Authors MUST provide a single <ol> child with <li><a> page links.
The active page is determined by aria-current="page" or URL match.
Supports box and open variants, default and small sizes, and compact
layout. Tab moves focus through steppers and input; Enter activates.
Screen readers announce the <nav> landmark with the label property.
Truncation with ellipsis appears automatically beyond 9 pages.
Edit element properties
import '@rhds/elements/rh-pagination/rh-pagination.js';
<meta itemprop="description" content="Default pagination with page links and numeric input.">
<rh-pagination>
<ol>
<li><a href="?page=1">1</a></li>
<li><a href="?page=2">2</a></li>
<li><a href="?page=3">3</a></li>
<li><a href="?page=4">4</a></li>
<li><a href="?page=5">5</a></li>
</ol>
</rh-pagination>
<link rel="stylesheet" href="../rh-pagination-lightdom.css">
import { Pagination } from "@rhds/elements/react/rh-pagination/rh-pagination.js";
// NOTE: React 19+ does not require these wrapper imports.
// You can use the custom elements directly as-is.
export const Demo = () => (
<meta itemprop="description" content="Default pagination with page links and numeric input." />
<Pagination>
<ol>
<li><a href="?page=1">1</a></li>
<li><a href="?page=2">2</a></li>
<li><a href="?page=3">3</a></li>
<li><a href="?page=4">4</a></li>
<li><a href="?page=5">5</a></li>
</ol>
</Pagination>
<link rel="stylesheet" href="../rh-pagination-lightdom.css" />
);
Controls which end(s) of the page list are truncated with ellipsis.
Accepts 'start' | 'end' | 'both' | null. Computed automatically
from page count and current index. Reflected to the host attribute so
light-DOM CSS can hide overflow <li> elements. Defaults to null.
Accessible label for the <nav> landmark. SHOULD be unique when multiple paginations exist on a page. Defaults to 'Page navigation'.
Accessible label for the first-page stepper button. Used by screen readers. Defaults to 'first page'.
Accessible label for the previous-page stepper button. Used by screen readers. Defaults to 'previous page'.
Accessible label for the next-page stepper button. Used by screen readers. Defaults to 'next page'.
Accessible label for the last-page stepper button. Used by screen readers. Defaults to 'last page'.
Controls pagination size. Accepts 'sm' for smaller touch targets (WCAG AA) or null for default (WCAG AAA). Defaults to null.
Visual variant. Accepts 'open' for transparent backgrounds with bottom borders, or null for the default box variant. Defaults to null.
Status
- Figma library:
-
Ready - RH Elements:
-
Ready - RH Shared Libs:
-
Ready
When to use
- When you need to divide large quantities of data or content into chunks
- When you need to enable users to navigate to through pages or locate a specific page number
- When you need to improve the loading performance of a system
Status checklist
| Property | Status | Meaning |
|---|---|---|
| Figma library |
|
Component is available in the Figma library |
| RH Elements |
|
Component is available in RH Elements |
| RH Shared Libs |
|
Component is available in RH Shared Libs |
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.