Navigation
Pagination
Navigate between pages of a list or table. Buttons by default, or real links with getHref.
import { Pagination } from '@reactloom/ui';Examples
Controlled
Showing invoices 126–150 of 500
import { Pagination, Stack, Text } from '@reactloom/ui';
import { useState } from 'react';
export default function Example() {
const [page, setPage] = useState(6);
return (
<Stack gap="3" align="center">
<Pagination pageCount={20} page={page} onPageChange={setPage} />
<Text size="sm" tone="muted" role="status">Showing invoices {page * 25 - 24}–{page * 25} of 500</Text>
</Stack>
);
}As links
Crawlable and router friendly.
import { Pagination } from '@reactloom/ui';
export default function Example() {
// Real links: crawlable, work without JavaScript, open in a new tab with ⌘/Ctrl-click.
return <Pagination pageCount={8} defaultPage={3} size="sm" getHref={(page) => `?page=${page}`} />;
}API reference
| Prop | Type | Default |
|---|---|---|
pageCountrequired | number | — |
page / defaultPage1-based. | number | 1 |
onPageChange | (page: number) => void | — |
siblingCount · boundaryCount | number | 1 · 1 |
getHrefRender links instead of buttons. | (page: number) => string | — |
size | 'sm' | 'md' | 'md' |
labelsTranslations. | { previous?, next?, page?(n) } | — |
Customization
Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.
State attributes
Target these in your CSS to style states without depending on class names.
| Attribute | Values |
|---|---|
[data-disabled] | present when on |
[data-size] | sm · md |
Theme tokens it reads
--pl-color-bg-subtle --pl-color-bg-surface --pl-color-border-input --pl-color-fg-default --pl-color-fg-disabled --pl-color-fg-muted --pl-control-height-md --pl-control-height-sm --pl-focus-ring-color --pl-focus-ring-width --pl-font-size-md --pl-font-size-sm --pl-radius-md --pl-shadow-xs
Accessibility
- A named nav landmark; the current page has aria-current="page".
- Each control has a full label (“Page 5”, “Next page”); ellipses are hidden.
| Key | Action |
|---|---|
| Tab | Move between pages |
Usage guidelines
Do
- Show the range (“26–50 of 500”) next to it.
Don’t
- Don’t paginate short lists.