structyl

Pagination

stable

Navigation bar matching DataTable pagination: page controls, rows-per-page selector, and total row count.

Basic usage

243 total rows
Page 3 of 10

Examples

With rows-per-page selector

Pass onPageSizeChange to show the rows-per-page dropdown alongside navigation.

389 total rows
Page 1 of 16

Standard pagination bar

Matches the DataTable pagination: First/Prev/Next/Last buttons, page dropdown, rows-per-page selector, and total row count.

389 total rows
Page 3 of 16

Features

  • First / prev / next / last buttons.
  • Page dropdown and rows-per-page selector.
  • Total row count display.

Installation

bash
pnpm dlx structyl add pagination

API Reference

Pagination

Full-featured pagination bar matching the DataTable pagination.

PropTypeDefault
pagenumber

Current page (1-based).

pageCountnumber

Total number of pages.

pageSizenumber

Current page size (default 10).

totalRowsnumber

Total row count shown on the left.

onPageChange(page: number) => void

Called on page navigation.

onPageSizeChange(size: number) => void

Called on page size change. If omitted the rows-per-page selector is hidden.

pageSizeOptionsnumber[]

Options for the rows-per-page selector (default [10, 25, 50, 100]).

showTotalRowsboolean

Show the total row count label (default true).

Pagination | structyl