How can I hide column based on a specific breakpoint ?
Hey, I want to hide columns based on some breakpoint.
What are the best practices to implement such feature ?
I see few potential way of implementation:
2nd option
The option 2 would be ideal, but I didn't find a way to have
meta
typesafe.
thanks in advance2 Replies
foreign-sapphire•2y ago
You can make the
meta
typesafe by declaring it on the TableMeta
interface.
Here's a reference for it: https://tanstack.com/table/v8/docs/api/core/table#metaTable | TanStack Table Docs
useReactTable / createSolidTable / useVueTable / createSvelteTable
`tsx
foreign-sapphire•2y ago
You could also, eliminate the JS calculation of
isSmallScreen
by passing in a classname and appending that onto your table column. This allows you to pass in a classname that is mapped to a media query in css.
This could leverage something like tailwindcss or any other implementation for moving the observer of this from JS to the browser (and native code).