v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

Pagination

Bounded page navigation, even for very large result sets.

Interactive preview

Showing page 1 of 12

Usage

import { Pagination } from "@devvy-ui/react";

<Pagination page={2} count={12} getHref={page => "?page=" + page} />

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
page / countnumber / numberrequiredCurrent page and total pages; finite integer normalization.
onPageChange OR getHrefcallback OR link builderrequiredChoose button state or real route links.
labelstringPaginationNavigation landmark name.

Accessibility & behavior

Platform Behavior & Guidelines

Only edges and nearby pages are rendered. Native buttons/links keep normal keyboard behavior. Current page has aria-current; unavailable previous/next controls cannot activate. Zero pages shows an empty state. Provide onPageChange for state mode; link mode does not intercept navigation.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add pagination

Make the source yours.

Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.

Pagination.tsxREACT / TSX

Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.