Replacing checkbox with Mantine's Switch in DataTable selection #679
-
Hi, I am working on implementing row selection in a Mantine DataTable and would like to replace the default checkboxes with Mantine's Switch component. I reviewed the documentation but couldn't find a clear approach for this. One idea I had is to use CSS to hide the checkbox column and display only the column with Switch components. However, I’m wondering if there's a simpler or more efficient way to achieve this. Any guidance or suggestions would be greatly appreciated. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The embedded Mantine DataTable selection mechanism relies on the Mantine Checkbox's indeterminate state property. I suggest you to implement your own solution to handle selection and I think you're on the right track. |
Beta Was this translation helpful? Give feedback.
The embedded Mantine DataTable selection mechanism relies on the Mantine Checkbox's indeterminate state property.
I suggest you to implement your own solution to handle selection and I think you're on the right track.
There's no need to use CSS to hide the checkbox columns, however.
The best way to do this would be to simply handle selection state outside the component and use custom cells rendering switches to display and alter it.