简体   繁体   中英

How can I show sorting icons all the time and with blue color for current sorting column in react material-table

I have create a material table using material-table liberary. I want to show the sorting icon all the time for all columns. Also color should be blue for the column which is currently sorted.

Below is the sandbox link for the code.

https://codesandbox.io/s/stupefied-mclean-okcvx?file=/src/App.js

How can I acheive the above expected output?

Is there any way to achieve this by overriding the components?

To always show sort icons (not only when hovering), you need to apply CSS style for your material-table.

styles.css

.App {
  font-family: sans-serif;
}
.MuiTableSortLabel-icon {
  opacity: 1;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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