Material-UI: TablePagination hide next and prev

Viewed 851

How to hide the next and prev button in the TablePagination component. Is it something that I have to do in css or configure the component in some way? At the same time I want to keep the exact position of the "Showing ... ".

enter image description here

1 Answers

There is no option to hide the next and back IconButton in TablePagination. So I'm afraid you have to rely on css.

If you want to remove the buttons completely, use display: none:

<TablePagination
  {...props}
  nextIconButtonProps={{ style: { display: "none" } }}
  backIconButtonProps={{ style: { display: "none" } }}
/>

If you want to hide the buttons and reserve the space where the buttons occupy, use visbility: hidden:

<TablePagination
  {...props}
  nextIconButtonProps={{ style: { visibility: "hidden" } }}
  backIconButtonProps={{ style: { visibility: "hidden" } }}
/>

Live Demo

Edit 66720179/material-ui-tablepagination-hide-next-and-prev/66724617#66724617

Related