React Pagination Component - Material UI
React Pagination Component - Material UI
Pagination
The Pagination component enables the user to select a specific page from a range of
pages.
MUI for enterprise. Save time and reduce risk. Managed open source —
backed by maintainers.
ad by MUI
Basic pagination
1 … 6 7 8 9 10
1 … 4 5 6 … 10
1 2 3 4 5 … 10
1 2 3 4 5 … 10
Outlined pagination
1 2 3 4 5 … 10
https://mui.com/material-ui/react-pagination/ 1/6
06/10/2022, 09:54 React Pagination component - Material UI
1 2 3 4 5 … 10
1 2 3 4 5 … 10
1 2 3 4 5 … 10
Rounded pagination
1 2 3 4 5 … 10
1 2 3 4 5 … 10
Pagination size
1 2 3 4 5 … 10
1 2 3 4 5 … 10
1 2 3 4 5 … 10
https://mui.com/material-ui/react-pagination/ 2/6
06/10/2022, 09:54 React Pagination component - Material UI
Buttons
You can optionally enable first-page and last-page buttons, or disable the previous-page and
next-page buttons.
1 2 3 4 5 … 10
1 2 3 4 5 … 10
Custom icons
It's possible to customize the control icons.
1 … 4 5 6 … 10
<Pagination
count={10}
renderItem={(item) => (
<PaginationItem
components={{ previous: ArrowBackIcon, next: ArrowForwardIcon }}
{...item}
/>
)}
/>
Pagination ranges
You can specify how many digits to display either side of current page with the siblingRange
prop, and adjacent to the start and end page number with the boundaryRange prop.
1 … 6 … 11
1 … 5 6 7 … 11
1 2 6 10 11
https://mui.com/material-ui/react-pagination/ 3/6
06/10/2022, 09:54 React Pagination component - Material UI
1 2 … 6 … 10 11
1 2 … 5 6 7 … 10 11
Controlled pagination
Page: 1
1 2 3 4 5 … 10
<Typography>Page: {page}</Typography>
<Pagination count={10} page={page} onChange={handleChange} />
Router integration
1 2 3 4 5 … 10
usePagination
For advanced customization use cases, a headless usePagination() hook is exposed.
It
accepts almost the same options as the Pagination component minus all the props
related to
the rendering of JSX.
The Pagination component is built on this hook.
https://mui.com/material-ui/react-pagination/ 4/6
06/10/2022, 09:54 React Pagination component - Material UI
previous 1 2 3 4 5 … 10 next
Table pagination
The Pagination component was designed to paginate a list of arbitrary items when infinite
loading isn't used.
It's preferred in contexts where SEO is important, for instance, a blog.
For the pagination of a large set of tabular data, you should use the TablePagination
component.
<TablePagination
component="div"
count={100}
page={page}
onPageChange={handleChangePage}
rowsPerPage={rowsPerPage}
onRowsPerPageChange={handleChangeRowsPerPage}
/>
⚠️ Note that the page prop starts at 1 to match the requirement of including
Pagination
the value in the URL, while the TablePagination page prop starts at 0 to match the
requirement of zero-based JavaScript arrays that comes with rendering a lot of tabular
data.
You can learn more about this use case in the table section of the documentation.
Accessibility
ARIA
https://mui.com/material-ui/react-pagination/ 5/6
06/10/2022, 09:54 React Pagination component - Material UI
The root node has a role of "navigation" and aria-label "pagination navigation" by default. The
page items have an aria-label that identifies the purpose of the item ("go to first page", "go to
previous page", "go to page 1" etc.). You can override these using the getItemAriaLabel prop.
Keyboard
The pagination items are in tab order, with a tabindex of "0".
API
<Pagination />
<PaginationItem />
https://mui.com/material-ui/react-pagination/ 6/6