Hoppa till huvudinnehåll

Pagination

Paginering

Paginering för tabeller, anpassad för @tanstack/react-table. Se exempel på användning under vår guide för Tanstack Table

API

NameTypeDefaultDescription
pageSizeOptions[10, 20, 30, 40, 50]

Options for different page sizes

getCanNextPage *() => boolean-

Returns whether the table can go to the next page. API Docs Guide

getCanPreviousPage *() => boolean-

Returns whether the table can go to the previous page. API Docs Guide

getPageCount *() => number-

Returns the page count. If manually paginating or controlling the pagination state, this will come directly from the options.pageCount table option, otherwise it will be calculated from the table data using the total row count and current page size. API Docs Guide

getRowCount *() => number-

Returns the row count. If manually paginating or controlling the pagination state, this will come directly from the options.rowCount table option, otherwise it will be calculated from the table data. API Docs Guide

nextPage *() => void-

Increments the page index by one, if possible. API Docs Guide

previousPage *() => void-

Decrements the page index by one, if possible. API Docs Guide

setPageIndex *(updater: Updater<number>) => void-

Updates the page index using the provided function or value in the state.pagination.pageIndex state. API Docs Guide

setPageSize *(updater: Updater<number>) => void-

Updates the page size using the provided function or value in the state.pagination.pageSize state. API Docs Guide

pageIndex *number-
pageSize *number-