Demo of React Table V7 using TypeScript as well as Material UI
- Open this example in a new CodeSandbox
yarnandyarn startto run and edit the example
This example uses:
useGroupByto enable header groupsuseFiltersfor per-column filters. Note that filters are displayed in a separate filter dropdown rather than being embedded in each column header.useSortByfor column sortinguseExpandedto allow expansion of grouped columnsuseFlexLayoutfor a scalable full width tableusePaginationfor paginationuseResizeColumnsfor resizable columnsuseRowSelectfor row selection
Other features:
- Demonstrates hiding columns.
- use
react-json-viewto optionally display the table instance for better exploration. - use
useLocalStorageanduseDebounce, both from https://usehooks.com to persist table settings.
Several parts of this demo are pulled from examples that are available at https://github.com/tannerlinsley/react-table/tree/master/examples that are copyright Tanner Linsley
This example uses a pre-released version of @types/react-table that fixes the types to support rc.16 to work with fixed width columns. Note that this requires patch-package which doesn't work on codesandbox.io.