Skip to content

TkxPagination

import { TkxPagination } from 'tekivex-ui';
<TkxPagination
total={250}
pageSize={10}
page={current}
onChange={setCurrent}
/>
siblingCount={0} — compact

Controls how many pages on each side of the current page are shown:

<TkxPagination total={1000} pageSize={10} siblingCount={1} /> {/* default */}
<TkxPagination total={1000} pageSize={10} siblingCount={2} /> {/* wider */}
<TkxPagination total={1000} pageSize={10} siblingCount={0} /> {/* compact */}

When the gap is too large, an ellipsis () renders instead of consecutive page numbers.

<TkxPagination total={500} pageSize={10} showEdges />

The first/last buttons are useful for very large data sets. They share the localised “First page” / “Last page” aria-label.

With page-size selector
<TkxPagination
total={total}
page={page}
onChange={setPage}
pageSize={pageSize}
showPageSize
pageSizeOptions={[10, 25, 50, 100]}
onPageSizeChange={setPageSize}
/>
<TkxPagination size="sm" {...props} />
<TkxPagination size="md" {...props} /> {/* default */}
<TkxPagination size="lg" {...props} />

Pagination renders the “Showing X–Y of Z items” line, “Page N” labels for buttons, and “Previous page” / “Next page” aria-labels — all from the active locale, with English fallbacks for the optional fields.

  • Renders as <nav aria-label="Pagination">
  • Disabled buttons get the native disabled attribute (not just visual)
  • Active page button has aria-current="page"
  • Each page button gets aria-label="Page N"
  • Edge buttons (first/last) hidden when showEdges={false}
PropTypeRequiredDescription
totalnumberyesTotal item count.
pageSizenumberDefaults to 10.
pagenumberControlled current page (1-based).
defaultPagenumberUncontrolled initial page.
onChange(page: number) => voidPage change callback.
siblingCountnumberPages on each side of current. Defaults to 1.
showEdgesbooleanFirst/last buttons. Defaults to true.
showPageSizebooleanRender page-size dropdown.
pageSizeOptionsnumber[]Defaults to [10, 25, 50, 100].
size'sm' | 'md' | 'lg'Defaults to md.

src/components/TkxPagination.tsx