PaginationConfig()

Usage

Source

PaginationConfig(**kwargs)

Description

Build a compact pagination configuration dictionary for client-side or server-side paging.

Parameters

page: int | float

Description: Current page number in controlled pagination mode. Example: page=1.

pageSize: int | float

Description: Number of rows shown per page when using the pageSize prop. Example: pageSize=25.

recordsPerPage: int | float

Description: Preferred page-size prop matching Mantine DataTable’s API. Example: recordsPerPage=25.

totalRecords: int | float

Description: Total number of records available, typically required for server-side pagination. Example: totalRecords=248.

recordsPerPageOptions: list[int | float]

Description: Page-size choices shown in the footer control. Example: recordsPerPageOptions=[10, 25, 50, 100].

pageSizeOptions: list[int | float]

Description: Alternative page-size options prop. Example: pageSizeOptions=[10, 25, 50].

recordsPerPageLabel: str

Description: Label shown next to the page-size selector. Example: recordsPerPageLabel="Rows".

paginationSize: str | int | float

Description: Visual size of the pagination controls. Expected inputs: Mantine size tokens such as 'xs', 'sm', 'md', 'lg', 'xl', or a numeric size when supported. Example: paginationSize="sm".

paginationActiveTextColor: str | dict

Description: Text color for the active page button. Example: paginationActiveTextColor="white".

paginationActiveBackgroundColor: str | dict

Description: Background color for the active page button. Example: paginationActiveBackgroundColor="blue.6".

paginationWithEdges: bool

Description: Shows first/last page controls when True. Example: paginationWithEdges=True.

paginationWithControls: bool
Description: Shows previous/next controls when True. Example: paginationWithControls=True.

Returns

dict
A dictionary with None values removed.

Notes

For most apps you will set either recordsPerPage or pageSize, not both. This helper simply forwards whatever keys you provide.

Examples

>>> PaginationConfig(page=2, recordsPerPage=25, totalRecords=240)
{'page': 2, 'recordsPerPage': 25, 'totalRecords': 240}