Pagination
1–10 of 128
1–10 of 128
Previous / Next page controls with optional page numbers, a range count and a page-size select; narrow spaces get arrow buttons. The ref, className, style and other attributes go to the outer element.
A Markdown brief for Claude, Cursor or v0: install, setup, props and a complete example.
For long lists split into pages, with the count of results.
A feed people read straight through? A "Show more" Button may suit better.
A labeled navigation region. Each page number is named, and the current one carries aria-current.
import { Pagination } from '@idyeah/diya'Stable since 1.0.0
onPageChangeRequired(page: number) => voidCalled with the 1-based page a person picks.
pageRequirednumberCurrent page, starting at 1; clamped to the pages that exist.
pageSizeRequirednumberItems per page.
totalRequirednumberTotal number of items across all pages, not the number of pages.
onPageSizeChange(size: number) => voidWhen given, shows a "Per page" select and is called with the new size.
pageSizeOptionsnumber[]Sizes offered by the "Per page" select; the current pageSize is always included. Defaults to [10, 25, 50].
Default [10,25,50]
showCountbooleanShows the visible range, such as "11–20 of 42", announced as a status. Defaults to true.
Default true
showNumbersbooleanShows numbered page buttons between Previous and Next, with gaps for long runs. Defaults to true.
Default true
Also takes every native <div> attribute, such as id, aria-* or data-*.