Pagination API
View componentThe full prop reference for the Pagination component. Navigation bar matching DataTable pagination: page controls, rows-per-page selector, and total row count.
Import
import { Pagination } from '@structyl/styled';Props
Pagination
A data-table pagination component with page navigation, rows-per-page selector, and total row count display. Supports both page selection and page size configuration.
| Prop | Type | Default |
|---|---|---|
| page# | numberCurrent page number (1-based), required | — |
| pageCount# | numberTotal number of pages, required | — |
| pageSize# | numberCurrent page size (rows per page) | 10 |
| totalRows# | number | undefinedTotal row count shown on the left | — |
| onPageChange# | (page: number) => voidCalled when the user navigates to a different page, required | — |
| onPageSizeChange# | ((pageSize: number) => void) | undefinedCalled when the user changes the page size; if omitted the rows-per-page selector is hidden | — |
| pageSizeOptions# | number[]Options for the rows-per-page selector | [10, 25, 50, 100] |
| showTotalRows# | booleanShow the 'X total rows' label (only visible when totalRows is provided) | true |
| className# | string | undefinedAdditional CSS classes applied to the root div | — |
Pagination.Root
Headless primitive pagination component with basic page navigation. Extends HTML nav element. This is the low-level primitive; most users should use the styled Pagination component instead.
| Prop | Type | Default |
|---|---|---|
| current# | number | undefinedCurrent page number (1-based) | 1 |
| total# | number | undefinedTotal number of pages | 1 |
| onChange# | ((page: number) => void) | undefinedCalled when the user navigates to a different page | — |
| className# | string | undefinedAdditional CSS classes | — |
Source code
If you didn't find what you need here, read the component implementation .