Pagination
Pages through a long list: how many are showing, an optional rows-per-page choice, then previous, the pages around the current one with an ellipsis for each gap, and next. Built on ui-sdk's Pagination: the current page has aria-current, and previous and next stay focusable but disabled at the ends.
BetaReady to use. Its API can still change in a minor release; the changelog says when.
import { Pagination } from "@leap-crm/design-system";Playground
Change a prop and the component follows. Its code is under Props.
Props
Best practices
When to use it, and the rules that apply in particular places.
| Guidance | Practice |
|---|---|
| Do | Use it under a long list or table where people jump to a place, like page 4 of a firm's contacts. |
| Do | Set itemName so the count reads "Showing 1–25 of 312 contacts", and give each pagination on a page its own aria-label, like "Contacts pages". |
| Do | With pageSizeOptions, hold the size in state: pass it back as pageSize from onPageSizeChange and go back to page 1. |
| Do | Pass getHref when each page has its own URL, so a lawyer can reopen or share the page they were on. |
| Don't | Disable previous or next yourself at the ends. They already stay focusable but disabled, so keyboard users don't lose their place. |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| page | number | — | The current page, from 1. Pass it to control the pagination. |
| defaultPage | number | — | The page it starts on, when uncontrolled. |
| onPageChange | (page: number) => void | — | Runs with the page to show next, from 1. |
| total * | number | — | How many items there are in all. |
| pageSize | number | 25 | Items on a page. |
| pageSizeOptions | number[] | — | Offers a page-size choice with these sizes, like [25, 50, 100]. |
| onPageSizeChange | (pageSize: number) => void | — | Runs with the page size chosen. Go back to page 1 when it changes. |
| itemName | string | — | What the items are, for "Showing 1–25 of 312 contacts". |
| getHref | (page: number) => string | — | Makes each page a link, for pages with their own URL. |
| siblings | number | 1 | Pages shown either side of the current one before an ellipsis. |
| disabled | boolean | — | Shows it as unavailable and stops it responding. |
| aria-label | string | "Pagination" | Names the navigation, like "Contacts pages". |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
Code
What the playground shows, ready to copy.
import { Pagination } from "@leap-crm/design-system";
<Pagination total={240} />Rows per page
pageSizeOptions adds the choice; changing it goes back to page 1.
Few pages, and links
Three pages show without ellipses. getHref makes every page a link, for lists whose pages have their own URL.
What the examples share
The imports and the scaffolding the examples above call. The scaffolding lives in this page, not in the library.
import { useState } from "react";
import { Pagination } from "@leap-crm/design-system";
function WithPageSize() {
const [pageSize, setPageSize] = useState(25);
const [page, setPage] = useState(1);
return (
<Pagination
total={312}
itemName="contacts"
page={page}
onPageChange={setPage}
pageSize={pageSize}
pageSizeOptions={[25, 50, 100]}
onPageSizeChange={size => {
setPageSize(size);
setPage(1);
}}
aria-label="Contacts pages"
/>
);
}Keyboard
The keys it answers to. Tab moves between components, arrows move within them.
| Keys | What they do |
|---|---|
| EnterSpace | Go to the focused page. |





