Skip to content
SENVENLI UI

Pagination

Moves through pages of results with page numbers, previous/next and a page-size choice.
Pages of results
import { Pagination } from "@senvenli/react/navigation";

Examples

With a page-size choice

Changing the size goes back to the first page.

Naming the items

A formatRange function writes the range sentence; format its numbers for the locale yourself.

Guidelines

When to use it

  • A list or table with more results than fit one page.

Use something else when

  • The rows already live in a table with paging built in. Data table
  • A single Load more continues a feed. Button

Accessibility

Built in

  • The current page is marked; the range is announced ("41–60 of 1,204").

API reference

Pagination

pageRequired
number

1-based. Keep it in the URL so back and refresh return to it.

pageSizeRequired
number
totalRequired
number

All items across pages.

onPageChangeRequired
(page: number) => void
onPageSizeChange
(pageSize: number) => void
pageSizeOptions
readonly number[]Default [20, 50, 100]

20, 50 and 100 by default; the current size joins the list when it is not in it.

formatRange
(from: number, to: number, total: number) => string

The range sentence naming the items: (41, 60, 1204) → "41–60 of 1,204 orders". It gets the raw numbers; format them for the locale yourself (Intl.NumberFormat).