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

For examples and details on the usage of this React component, visit the component demo pages:

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.

countRequired

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

Type:

integer
onPageChangeRequired

Callback fired when the page is changed.

Type:

func

Signature:

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

The zero-based index of the current page.

Type:

integer
rowsPerPageRequired

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

Type:

integer
ActionsComponent

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

Type:

elementType

Default:

TablePaginationActions
backIconButtonProps

Props applied to the back arrow IconButton component.

Type:

object
classes

Override or extend the styles applied to the component.

Type:

object
component

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

Type:

elementType
getItemAriaLabel

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`; }

Signature:

function(type: string) => string
  • type The link or button type to format ('first' | 'last' | 'next' | 'previous').
labelDisplayedRows

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}`}`; }
labelRowsPerPage

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

Type:

node

Default:

'Rows per page:'
nextIconButtonProps

Props applied to the next arrow IconButton element.

Type:

object
onRowsPerPageChange

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

Type:

func

Signature:

function(event: React.ChangeEvent) => void
  • event The event source of the callback.
rowsPerPageOptions

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]
SelectProps

Props applied to the rows per page Select element.

Type:

object

Default:

{}
showFirstButton

If true, show the first-page button.

Type:

bool

Default:

false
showLastButton

If true, show the last-page button.

Type:

bool

Default:

false
sx

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

Type:

Array<func | object | bool> | func | object

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

The following class names are useful for styling with CSS (the state classes are marked).
To learn more, visit the component customization page.

.MuiTablePagination-rootroot

Styles applied to the root element.

.MuiTablePagination-toolbartoolbar

Styles applied to the Toolbar component.

.MuiTablePagination-spacerspacer

Styles applied to the spacer element.

.MuiTablePagination-selectLabelselectLabel

Styles applied to the select label Typography element.

.MuiTablePagination-selectRootselectRoot

Styles applied to the Select component root element.

.MuiTablePagination-selectselect

Styles applied to the Select component select class.

.MuiTablePagination-selectIconselectIcon

Styles applied to the Select component icon class.

.MuiTablePagination-inputinput

Styles applied to the Select component root element.

.MuiTablePagination-menuItemmenuItem

Styles applied to the MenuItem component.

.MuiTablePagination-displayedRowsdisplayedRows

Styles applied to the displayed rows Typography element.

.MuiTablePagination-actionsactions

Styles applied to the internal TablePaginationActions component.

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