Skip to content

TablePagination API

API reference docs for the React TablePagination component. Learn about the props, CSS, and other APIs of this exported module.

Demos

Import

import TablePagination from '@mui/material/TablePagination';
// or
import { TablePagination } from '@mui/material';

Learn about the difference by reading this guide on minimizing bundle size.



A TableCell based component for placing inside TableFooter for pagination.

Props

Props of the TableCell component are also available.

NameTypeDefaultDescription
count*integer-

The total number of rows.
To enable server side pagination for an unknown number of items, provide -1.

onPageChange*func-

Callback fired when the page is changed.

Signature:function(event: React.MouseEvent | null, page: number) => void
  • event The event source of the callback.
  • page The page selected.
page*integer-

The zero-based index of the current page.

rowsPerPage*integer-

The number of rows per page.
Set -1 to display all the rows.

ActionsComponentelementTypeTablePaginationActions

The component used for displaying the actions. Either a string to use a HTML element or a component.

backIconButtonPropsobject-

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.

classesobject-

Override or extend the styles applied to the component.

See CSS classes API below for more details.

componentelementType-

The component used for the root node. Either a string to use a HTML element or a component.

disabledboolfalse

If true, the component is disabled.

getItemAriaLabelfuncfunction defaultGetAriaLabel(type) { return `Go to ${type} page`; }

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.

Signature:function(type: string) => string
  • type The link or button type to format ('first' | 'last' | 'next' | 'previous').
labelDisplayedRowsfuncfunction defaultLabelDisplayedRows({ from, to, count }) { return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`; }

Customize the displayed rows label. Invoked with a { from, to, count, page } object.
For localization purposes, you can use the provided translations.

labelRowsPerPagenode'Rows per page:'

Customize the rows per page label.
For localization purposes, you can use the provided translations.

nextIconButtonPropsobject-

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.

onRowsPerPageChangefunc-

Callback fired when the number of rows per page is changed.

Signature:function(event: React.ChangeEvent) => void
  • event The event source of the callback.
rowsPerPageOptionsArray<number
| { label: string, value: number }>
[10, 25, 50, 100]

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.

SelectPropsobject{}

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.

showFirstButtonboolfalse

If true, show the first-page button.

showLastButtonboolfalse

If true, show the last-page button.

slotProps{ actions?: { firstButton?: object, firstButtonIcon?: object, lastButton?: object, lastButtonIcon?: object, nextButton?: object, nextButtonIcon?: object, previousButton?: object, previousButtonIcon?: object }, select?: object }{}

The props used for each slot inside the TablePagination.

slots{ actions?: { firstButton?: elementType, firstButtonIcon?: elementType, lastButton?: elementType, lastButtonIcon?: elementType, nextButton?: elementType, nextButtonIcon?: elementType, previousButton?: elementType, previousButtonIcon?: elementType } }{}

The components used for each slot inside the TablePagination. Either a string to use a HTML element or a component.

sxArray<func
| object
| bool>
| func
| object
-

The system prop that allows defining system overrides as well as additional CSS styles.

See the `sx` page for more details.

The 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.

CSS classes

These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.

Class nameRule nameDescription
.MuiTablePagination-actionsactionsStyles applied to the internal TablePaginationActions component.
.MuiTablePagination-displayedRowsdisplayedRowsStyles applied to the displayed rows Typography element.
.MuiTablePagination-inputinputStyles applied to the Select component root element.
.MuiTablePagination-menuItemmenuItemStyles applied to the MenuItem component.
.MuiTablePagination-rootrootStyles applied to the root element.
.MuiTablePagination-selectselectStyles applied to the Select component select class.
.MuiTablePagination-selectIconselectIconStyles applied to the Select component icon class.
.MuiTablePagination-selectLabelselectLabelStyles applied to the select label Typography element.
.MuiTablePagination-selectRootselectRootStyles applied to the Select component root element.
.MuiTablePagination-spacerspacerStyles applied to the spacer element.
.MuiTablePagination-toolbartoolbarStyles applied to the Toolbar component.

You can override the style of the component using one of these customization options: