mui-datatables
mui-datatables copied to clipboard
Adding custom components to column header span after sort
I am looking for a way to add a custom component after the sort icon outside of the button. I think it would be beneficial to add a prop that would allow for injection of such components.

This is a decent amount of dead space which could be used for column specific actions like having a button for opening a modal for search or filter.
It would be easier then having to build a whole new header using what is already available.
Although I was not able to insert a custom component there, after some time of trial and error, I've found out that it's possible to apply the style justifyContent: 'center' to distribute the excessive space to the cell ends. I did it as so,
const getMuiTheme = () =>
createTheme({
components: {
MUIDataTableHeadCell: {
styleOverrides: {
contentWrapper: {
justifyContent: 'center',
},
},
},
},
});