TablePagination API
API reference docs for the React TablePagination component. Learn about the props, CSS, and other APIs of this exported module.
Component demos
Import
import TablePagination from '@mui/material/TablePagination';
// or
import { TablePagination } from '@mui/material';
A TableCell
based component for placing inside TableFooter
for pagination.
Props of the TableCell component are also available.
The total number of rows.
To enable server side pagination for an unknown number of items, provide -1.
Type:integer
Callback fired when the page is changed.
Type:func
function(event: React.MouseEvent | null, page: number) => void
event
The event source of the callback.page
The page selected.
The component used for displaying the actions. Either a string to use a HTML element or a component.
Type:elementType
Default:TablePaginationActions
Props applied to the back arrow IconButton
component.
This prop is an alias for slotProps.actions.previousButton
and will be overriden by it if both are used.
Type:object
Override or extend the styles applied to the component.
See CSS API below for more details.
Type:object
The component used for the root node. Either a string to use a HTML element or a component.
Type:elementType
Accepts a function which returns a string value that provides a user-friendly name for the current page. This is important for screen reader users.
For localization purposes, you can use the provided translations.
Type:func
Default:function defaultGetAriaLabel(type) {
return `Go to ${type} page`;
}
function(type: string) => string
type
The link or button type to format ('first' | 'last' | 'next' | 'previous').
Customize the displayed rows label. Invoked with a { from, to, count, page }
object.
For localization purposes, you can use the provided translations.
Type:func
Default:function defaultLabelDisplayedRows({ from, to, count }) {
return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
}
Customize the rows per page label.
For localization purposes, you can use the provided translations.
Type:node
Default:'Rows per page:'
Props applied to the next arrow IconButton
element.
This prop is an alias for slotProps.actions.nextButton
and will be overriden by it if both are used.
Type:object
Callback fired when the number of rows per page is changed.
Type:func
function(event: React.ChangeEvent) => void
event
The event source of the callback.
Customizes the options of the rows per page select field. If less than two options are available, no select field will be displayed. Use -1 for the value with a custom label to show all the rows.
Type:Array<number
| { label: string, value: number }>
Default:[10, 25, 50, 100]
Props applied to the rows per page Select
element.
This prop is an alias for slotProps.select
and will be overriden by it if both are used.
Type:object
Default:{}
The props used for each slot inside the TablePagination.
Type:{ actions?: { firstButton?: object, lastButton?: object, nextButton?: object, previousButton?: object }, select?: object }
Default:{}
The system prop that allows defining system overrides as well as additional CSS styles.
See the `sx` page for more details.
Type:Array<func
| object
| bool>
| func
| object
ref
is forwarded to the root element.Inheritance
While not explicitly documented above, the props of the TableCell component are also available in TablePagination. You can take advantage of this to target nested components.
Theme default props
You can use MuiTablePagination
to change the default props of this component with the theme.
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
Styles applied to the internal TablePaginationActions
component.
Rule name:actions
Styles applied to the displayed rows Typography element.
Rule name:displayedRows
Styles applied to the Select component icon
class.
Rule name:selectIcon
Styles applied to the select label Typography element.
Rule name:selectLabel
Styles applied to the Select component root
element.
Rule name:selectRoot
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.