简体   繁体   English

MUI 如何更改 TablePagination 组件内的图标?

[英]MUI how can I change the icon inside the TablePagination component?

In my React project, I am using MUI component called TablePagination在我的 React 项目中,我使用了名为TablePagination的 MUI 组件

TablePagination component is nested inside of the Table component like the picture below. TablePagination组件嵌套在Table组件内部,如下图所示。

在此处输入图像描述

See how the dropdown button has a solid arrow pointing down.查看下拉按钮如何有一个向下的实心箭头。 How can I change this to a different SVG icon.如何将其更改为不同的 SVG 图标。

I want the new TablePagination to have an arrow icon from the below picture.我希望新的TablePagination具有下图中的箭头图标。

在此处输入图像描述

https://codesandbox.io/s/ijm5r?file=/demo.js https://codesandbox.io/s/ijm5r?file=/demo.js

Here is the link to the sandbox for this example.这是此示例的沙箱链接。

You can add a custom icon of the Select inside TablePagination like below:您可以在Select中添加TablePagination的自定义图标,如下所示:

<TablePagination
  SelectProps={{
    IconComponent: KeyboardArrowDownIcon,
  }}

Codesandbox 演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM