You can enable pagination by setting the following Mantine DataTable properties:
page: number
onPageChange
totalRecords: number
recordsPerPage: number
If you’re not happy with the default pagination behavior, you can override it by setting these optional properties:
loadingText: string
noRecordsText: string
paginationText
{ from: number; to: number; totalRecords: number }
and returning a ReactNode
representing the pagination text.paginationSize: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
paginationWrapBreakpoint: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | (string & {}) | number
sm
.string
like '300px'
or '20rem'
, or a number
, in which case it will be interpreted as a pixel value and converted to rem value before being applied.paginationActiveTextColor: MantineColor | { light: MantineColor; dark: MantineColor }
MantineColor
(key of theme.colors
or any valid CSS color string), or an object with light
and dark
keys and MantineColor
values.paginationActiveBackgroundColor: MantineColor | { light: MantineColor; dark: MantineColor }
MantineColor
(key of theme.colors
or any valid CSS color string), or an object with light
and dark
keys and MantineColor
values.Here is the code:
Displaying a page size selectorYou can display a selector to let the user choose the page size by setting the following component properties:
recordsPerPageOptions: number[]
onRecordsPerPageChange
recordsPerPageLabel
You can provide additional props to pagination controls by using the getPaginationControlProps
callback. For example, if you’re not happy with the default accessibility aria-labels, you can override them like so:
Head over to the next example to discover more features.
Mantine DataTable is trusted byRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4