How can I initially hide the "Show/Hide columns" button in material-react-table?
I searched through the documentation but couldn't find any information on how to hide this button.
Thanks in advance.
How can I initially hide the "Show/Hide columns" button in material-react-table?
I searched through the documentation but couldn't find any information on how to hide this button.
Thanks in advance.
You can remove the column hiding button from the top toolbar by setting the enableHiding
prop to false
in Material React Table.
Example:
<MaterialReactTable
columns={columns}
data={data}
enableHiding={false}
/>
Result:
Working CodeSandbox: https://codesandbox.io/p/sandbox/dreamy-browser-s8893s?file=%2Fsrc%2FTS.tsx%3A106%2C36
You can hide all of the default toolbar buttons using these settings.
The docs don't cover these settings unfortunately, if you choose to hide the toolbar entirely you will lose access to certain features such as the top of table progress bar.