@novastera-oss/material-react-table 4.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +233 -0
- package/dist/index.cjs +5190 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1871 -0
- package/dist/index.js +5084 -0
- package/dist/index.js.map +1 -0
- package/locales/ar/index.d.ts +3 -0
- package/locales/ar/index.esm.d.ts +3 -0
- package/locales/ar/index.esm.js +96 -0
- package/locales/ar/index.js +98 -0
- package/locales/ar/package.json +6 -0
- package/locales/az/index.d.ts +3 -0
- package/locales/az/index.esm.d.ts +3 -0
- package/locales/az/index.esm.js +96 -0
- package/locales/az/index.js +98 -0
- package/locales/az/package.json +6 -0
- package/locales/bg/index.d.ts +3 -0
- package/locales/bg/index.esm.d.ts +3 -0
- package/locales/bg/index.esm.js +96 -0
- package/locales/bg/index.js +98 -0
- package/locales/bg/package.json +6 -0
- package/locales/cs/index.d.ts +3 -0
- package/locales/cs/index.esm.d.ts +3 -0
- package/locales/cs/index.esm.js +96 -0
- package/locales/cs/index.js +98 -0
- package/locales/cs/package.json +6 -0
- package/locales/da/index.d.ts +3 -0
- package/locales/da/index.esm.d.ts +3 -0
- package/locales/da/index.esm.js +96 -0
- package/locales/da/index.js +98 -0
- package/locales/da/package.json +6 -0
- package/locales/de/index.d.ts +3 -0
- package/locales/de/index.esm.d.ts +3 -0
- package/locales/de/index.esm.js +96 -0
- package/locales/de/index.js +98 -0
- package/locales/de/package.json +6 -0
- package/locales/el/index.d.ts +3 -0
- package/locales/el/index.esm.d.ts +3 -0
- package/locales/el/index.esm.js +96 -0
- package/locales/el/index.js +98 -0
- package/locales/el/package.json +6 -0
- package/locales/en/index.d.ts +3 -0
- package/locales/en/index.esm.d.ts +3 -0
- package/locales/en/index.esm.js +96 -0
- package/locales/en/index.js +98 -0
- package/locales/en/package.json +6 -0
- package/locales/es/index.d.ts +3 -0
- package/locales/es/index.esm.d.ts +3 -0
- package/locales/es/index.esm.js +96 -0
- package/locales/es/index.js +98 -0
- package/locales/es/package.json +6 -0
- package/locales/et/index.d.ts +3 -0
- package/locales/et/index.esm.d.ts +3 -0
- package/locales/et/index.esm.js +96 -0
- package/locales/et/index.js +98 -0
- package/locales/et/package.json +6 -0
- package/locales/fa/index.d.ts +3 -0
- package/locales/fa/index.esm.d.ts +3 -0
- package/locales/fa/index.esm.js +96 -0
- package/locales/fa/index.js +98 -0
- package/locales/fa/package.json +6 -0
- package/locales/fi/index.d.ts +3 -0
- package/locales/fi/index.esm.d.ts +3 -0
- package/locales/fi/index.esm.js +96 -0
- package/locales/fi/index.js +98 -0
- package/locales/fi/package.json +6 -0
- package/locales/fr/index.d.ts +3 -0
- package/locales/fr/index.esm.d.ts +3 -0
- package/locales/fr/index.esm.js +96 -0
- package/locales/fr/index.js +98 -0
- package/locales/fr/package.json +6 -0
- package/locales/he/index.d.ts +3 -0
- package/locales/he/index.esm.d.ts +3 -0
- package/locales/he/index.esm.js +96 -0
- package/locales/he/index.js +98 -0
- package/locales/he/package.json +6 -0
- package/locales/hr/index.d.ts +3 -0
- package/locales/hr/index.esm.d.ts +3 -0
- package/locales/hr/index.esm.js +96 -0
- package/locales/hr/index.js +98 -0
- package/locales/hr/package.json +6 -0
- package/locales/hu/index.d.ts +3 -0
- package/locales/hu/index.esm.d.ts +3 -0
- package/locales/hu/index.esm.js +96 -0
- package/locales/hu/index.js +98 -0
- package/locales/hu/package.json +6 -0
- package/locales/hy/index.d.ts +3 -0
- package/locales/hy/index.esm.d.ts +3 -0
- package/locales/hy/index.esm.js +96 -0
- package/locales/hy/index.js +98 -0
- package/locales/hy/package.json +6 -0
- package/locales/id/index.d.ts +3 -0
- package/locales/id/index.esm.d.ts +3 -0
- package/locales/id/index.esm.js +96 -0
- package/locales/id/index.js +98 -0
- package/locales/id/package.json +6 -0
- package/locales/it/index.d.ts +3 -0
- package/locales/it/index.esm.d.ts +3 -0
- package/locales/it/index.esm.js +96 -0
- package/locales/it/index.js +98 -0
- package/locales/it/package.json +6 -0
- package/locales/ja/index.d.ts +3 -0
- package/locales/ja/index.esm.d.ts +3 -0
- package/locales/ja/index.esm.js +96 -0
- package/locales/ja/index.js +98 -0
- package/locales/ja/package.json +6 -0
- package/locales/ko/index.d.ts +3 -0
- package/locales/ko/index.esm.d.ts +3 -0
- package/locales/ko/index.esm.js +96 -0
- package/locales/ko/index.js +98 -0
- package/locales/ko/package.json +6 -0
- package/locales/nl/index.d.ts +3 -0
- package/locales/nl/index.esm.d.ts +3 -0
- package/locales/nl/index.esm.js +96 -0
- package/locales/nl/index.js +98 -0
- package/locales/nl/package.json +6 -0
- package/locales/no/index.d.ts +3 -0
- package/locales/no/index.esm.d.ts +3 -0
- package/locales/no/index.esm.js +96 -0
- package/locales/no/index.js +98 -0
- package/locales/no/package.json +6 -0
- package/locales/np/index.d.ts +3 -0
- package/locales/np/index.esm.d.ts +3 -0
- package/locales/np/index.esm.js +96 -0
- package/locales/np/index.js +98 -0
- package/locales/np/package.json +6 -0
- package/locales/pl/index.d.ts +3 -0
- package/locales/pl/index.esm.d.ts +3 -0
- package/locales/pl/index.esm.js +96 -0
- package/locales/pl/index.js +98 -0
- package/locales/pl/package.json +6 -0
- package/locales/pt/index.d.ts +3 -0
- package/locales/pt/index.esm.d.ts +3 -0
- package/locales/pt/index.esm.js +96 -0
- package/locales/pt/index.js +98 -0
- package/locales/pt/package.json +6 -0
- package/locales/pt-BR/index.d.ts +3 -0
- package/locales/pt-BR/index.esm.d.ts +3 -0
- package/locales/pt-BR/index.esm.js +96 -0
- package/locales/pt-BR/index.js +98 -0
- package/locales/pt-BR/package.json +6 -0
- package/locales/ro/index.d.ts +3 -0
- package/locales/ro/index.esm.d.ts +3 -0
- package/locales/ro/index.esm.js +96 -0
- package/locales/ro/index.js +98 -0
- package/locales/ro/package.json +6 -0
- package/locales/ru/index.d.ts +3 -0
- package/locales/ru/index.esm.d.ts +3 -0
- package/locales/ru/index.esm.js +96 -0
- package/locales/ru/index.js +98 -0
- package/locales/ru/package.json +6 -0
- package/locales/sk/index.d.ts +3 -0
- package/locales/sk/index.esm.d.ts +3 -0
- package/locales/sk/index.esm.js +96 -0
- package/locales/sk/index.js +98 -0
- package/locales/sk/package.json +6 -0
- package/locales/sr-Cyrl-RS/index.d.ts +3 -0
- package/locales/sr-Cyrl-RS/index.esm.d.ts +3 -0
- package/locales/sr-Cyrl-RS/index.esm.js +96 -0
- package/locales/sr-Cyrl-RS/index.js +98 -0
- package/locales/sr-Cyrl-RS/package.json +6 -0
- package/locales/sr-Latn-RS/index.d.ts +3 -0
- package/locales/sr-Latn-RS/index.esm.d.ts +3 -0
- package/locales/sr-Latn-RS/index.esm.js +96 -0
- package/locales/sr-Latn-RS/index.js +98 -0
- package/locales/sr-Latn-RS/package.json +6 -0
- package/locales/sv/index.d.ts +3 -0
- package/locales/sv/index.esm.d.ts +3 -0
- package/locales/sv/index.esm.js +96 -0
- package/locales/sv/index.js +98 -0
- package/locales/sv/package.json +6 -0
- package/locales/tr/index.d.ts +3 -0
- package/locales/tr/index.esm.d.ts +3 -0
- package/locales/tr/index.esm.js +96 -0
- package/locales/tr/index.js +98 -0
- package/locales/tr/package.json +6 -0
- package/locales/uk/index.d.ts +3 -0
- package/locales/uk/index.esm.d.ts +3 -0
- package/locales/uk/index.esm.js +96 -0
- package/locales/uk/index.js +98 -0
- package/locales/uk/package.json +6 -0
- package/locales/vi/index.d.ts +3 -0
- package/locales/vi/index.esm.d.ts +3 -0
- package/locales/vi/index.esm.js +96 -0
- package/locales/vi/index.js +98 -0
- package/locales/vi/package.json +6 -0
- package/locales/zh-Hans/index.d.ts +3 -0
- package/locales/zh-Hans/index.esm.d.ts +3 -0
- package/locales/zh-Hans/index.esm.js +96 -0
- package/locales/zh-Hans/index.js +98 -0
- package/locales/zh-Hans/package.json +6 -0
- package/locales/zh-Hant/index.d.ts +3 -0
- package/locales/zh-Hant/index.esm.d.ts +3 -0
- package/locales/zh-Hant/index.esm.js +96 -0
- package/locales/zh-Hant/index.js +98 -0
- package/locales/zh-Hant/package.json +6 -0
- package/package.json +103 -0
- package/src/components/MaterialReactTable.tsx +36 -0
- package/src/components/body/MRT_TableBody.tsx +233 -0
- package/src/components/body/MRT_TableBodyCell.tsx +356 -0
- package/src/components/body/MRT_TableBodyCellValue.tsx +130 -0
- package/src/components/body/MRT_TableBodyRow.tsx +306 -0
- package/src/components/body/MRT_TableBodyRowGrabHandle.tsx +61 -0
- package/src/components/body/MRT_TableBodyRowPinButton.tsx +58 -0
- package/src/components/body/MRT_TableDetailPanel.tsx +118 -0
- package/src/components/buttons/MRT_ColumnPinningButtons.tsx +73 -0
- package/src/components/buttons/MRT_CopyButton.tsx +91 -0
- package/src/components/buttons/MRT_EditActionButtons.tsx +135 -0
- package/src/components/buttons/MRT_ExpandAllButton.tsx +82 -0
- package/src/components/buttons/MRT_ExpandButton.tsx +106 -0
- package/src/components/buttons/MRT_GrabHandleButton.tsx +66 -0
- package/src/components/buttons/MRT_RowPinButton.tsx +84 -0
- package/src/components/buttons/MRT_ShowHideColumnsButton.tsx +50 -0
- package/src/components/buttons/MRT_ToggleDensePaddingButton.tsx +52 -0
- package/src/components/buttons/MRT_ToggleFiltersButton.tsx +40 -0
- package/src/components/buttons/MRT_ToggleFullScreenButton.tsx +51 -0
- package/src/components/buttons/MRT_ToggleGlobalFilterButton.tsx +46 -0
- package/src/components/buttons/MRT_ToggleRowActionMenuButton.tsx +126 -0
- package/src/components/footer/MRT_TableFooter.tsx +92 -0
- package/src/components/footer/MRT_TableFooterCell.tsx +111 -0
- package/src/components/footer/MRT_TableFooterRow.tsx +99 -0
- package/src/components/head/MRT_TableHead.tsx +95 -0
- package/src/components/head/MRT_TableHeadCell.tsx +357 -0
- package/src/components/head/MRT_TableHeadCellColumnActionsButton.tsx +100 -0
- package/src/components/head/MRT_TableHeadCellFilterContainer.tsx +52 -0
- package/src/components/head/MRT_TableHeadCellFilterLabel.tsx +180 -0
- package/src/components/head/MRT_TableHeadCellGrabHandle.tsx +91 -0
- package/src/components/head/MRT_TableHeadCellResizeHandle.tsx +96 -0
- package/src/components/head/MRT_TableHeadCellSortLabel.tsx +102 -0
- package/src/components/head/MRT_TableHeadRow.tsx +94 -0
- package/src/components/inputs/MRT_EditCellTextField.tsx +195 -0
- package/src/components/inputs/MRT_FilterCheckbox.tsx +94 -0
- package/src/components/inputs/MRT_FilterRangeFields.tsx +42 -0
- package/src/components/inputs/MRT_FilterRangeSlider.tsx +145 -0
- package/src/components/inputs/MRT_FilterTextField.tsx +610 -0
- package/src/components/inputs/MRT_GlobalFilterTextField.tsx +166 -0
- package/src/components/inputs/MRT_SelectCheckbox.tsx +133 -0
- package/src/components/menus/MRT_ActionMenuItem.tsx +62 -0
- package/src/components/menus/MRT_CellActionMenu.tsx +109 -0
- package/src/components/menus/MRT_ColumnActionMenu.tsx +354 -0
- package/src/components/menus/MRT_FilterOptionMenu.tsx +294 -0
- package/src/components/menus/MRT_RowActionMenu.tsx +90 -0
- package/src/components/menus/MRT_ShowHideColumnsMenu.tsx +181 -0
- package/src/components/menus/MRT_ShowHideColumnsMenuItems.tsx +204 -0
- package/src/components/modals/MRT_EditRowModal.tsx +114 -0
- package/src/components/table/MRT_Table.tsx +86 -0
- package/src/components/table/MRT_TableContainer.tsx +115 -0
- package/src/components/table/MRT_TableLoadingOverlay.tsx +58 -0
- package/src/components/table/MRT_TablePaper.tsx +91 -0
- package/src/components/toolbar/MRT_BottomToolbar.tsx +112 -0
- package/src/components/toolbar/MRT_LinearProgressBar.tsx +53 -0
- package/src/components/toolbar/MRT_TablePagination.tsx +241 -0
- package/src/components/toolbar/MRT_ToolbarAlertBanner.tsx +182 -0
- package/src/components/toolbar/MRT_ToolbarDropZone.tsx +82 -0
- package/src/components/toolbar/MRT_ToolbarInternalButtons.tsx +73 -0
- package/src/components/toolbar/MRT_TopToolbar.tsx +134 -0
- package/src/fns/aggregationFns.ts +3 -0
- package/src/fns/filterFns.ts +196 -0
- package/src/fns/sortingFns.ts +33 -0
- package/src/hooks/display-columns/getMRT_RowActionsColumnDef.tsx +28 -0
- package/src/hooks/display-columns/getMRT_RowDragColumnDef.tsx +29 -0
- package/src/hooks/display-columns/getMRT_RowExpandColumnDef.tsx +91 -0
- package/src/hooks/display-columns/getMRT_RowNumbersColumnDef.tsx +30 -0
- package/src/hooks/display-columns/getMRT_RowPinningColumnDef.tsx +24 -0
- package/src/hooks/display-columns/getMRT_RowSelectColumnDef.tsx +34 -0
- package/src/hooks/display-columns/getMRT_RowSpacerColumnDef.tsx +33 -0
- package/src/hooks/useMRT_ColumnVirtualizer.ts +124 -0
- package/src/hooks/useMRT_Effects.ts +106 -0
- package/src/hooks/useMRT_RowVirtualizer.ts +88 -0
- package/src/hooks/useMRT_Rows.ts +44 -0
- package/src/hooks/useMRT_TableInstance.ts +317 -0
- package/src/hooks/useMRT_TableOptions.ts +270 -0
- package/src/hooks/useMaterialReactTable.ts +12 -0
- package/src/icons.ts +73 -0
- package/src/index.ts +91 -0
- package/src/locales/ar.ts +97 -0
- package/src/locales/az.ts +97 -0
- package/src/locales/bg.ts +97 -0
- package/src/locales/cs.ts +98 -0
- package/src/locales/da.ts +97 -0
- package/src/locales/de.ts +97 -0
- package/src/locales/el.ts +97 -0
- package/src/locales/en.ts +97 -0
- package/src/locales/es.ts +97 -0
- package/src/locales/et.ts +98 -0
- package/src/locales/fa.ts +97 -0
- package/src/locales/fi.ts +98 -0
- package/src/locales/fr.ts +97 -0
- package/src/locales/he.ts +97 -0
- package/src/locales/hr.ts +97 -0
- package/src/locales/hu.ts +97 -0
- package/src/locales/hy.ts +97 -0
- package/src/locales/id.ts +98 -0
- package/src/locales/it.ts +97 -0
- package/src/locales/ja.ts +97 -0
- package/src/locales/ko.ts +97 -0
- package/src/locales/mk.ts +96 -0
- package/src/locales/nl.ts +97 -0
- package/src/locales/no.ts +99 -0
- package/src/locales/np.ts +98 -0
- package/src/locales/pl.ts +97 -0
- package/src/locales/pt-BR.ts +97 -0
- package/src/locales/pt.ts +97 -0
- package/src/locales/ro.ts +97 -0
- package/src/locales/ru.ts +97 -0
- package/src/locales/sk.ts +98 -0
- package/src/locales/sr-Cyrl-RS.ts +97 -0
- package/src/locales/sr-Latn-RS.ts +97 -0
- package/src/locales/sv.ts +97 -0
- package/src/locales/tr.ts +97 -0
- package/src/locales/uk.ts +97 -0
- package/src/locales/vi.ts +97 -0
- package/src/locales/zh-Hans.ts +96 -0
- package/src/locales/zh-Hant.ts +96 -0
- package/src/types.ts +1298 -0
- package/src/utils/cell.utils.ts +234 -0
- package/src/utils/column.utils.ts +209 -0
- package/src/utils/displayColumn.utils.ts +152 -0
- package/src/utils/row.utils.ts +260 -0
- package/src/utils/style.utils.ts +221 -0
- package/src/utils/tanstack.helpers.ts +64 -0
- package/src/utils/utils.ts +56 -0
- package/src/utils/virtualization.utils.ts +24 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Kevin Vandy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# Material React Table V4
|
|
2
|
+
|
|
3
|
+
This is a fork of [Material React Table](https://www.material-react-table.com/). It was created to provide maintenance and update dependencies to the latest standards, including support for:
|
|
4
|
+
- Material UI v9
|
|
5
|
+
- React 19 (Optimized: No `forwardRef`, internal performance stability)
|
|
6
|
+
- Vite 8 & Rollup 4
|
|
7
|
+
- ESLint 10
|
|
8
|
+
- TypeScript 6 (Zero runtime helpers)
|
|
9
|
+
|
|
10
|
+
The original repository has not seen updates for over a year and the v9 beta lacked progress. This version ensures the library remains usable in modern development stacks.
|
|
11
|
+
|
|
12
|
+
# Material React Table V3
|
|
13
|
+
|
|
14
|
+
View [Documentation](https://www.material-react-table.com/)
|
|
15
|
+
|
|
16
|
+
<a href="https://npmjs.com/package/material-react-table" target="_blank">
|
|
17
|
+
<img alt="" src="https://badgen.net/npm/v/material-react-table?color=blue" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://npmtrends.com/material-react-table" target="_blank">
|
|
20
|
+
<img alt="" src="https://badgen.net/npm/dt/material-react-table?label=installs&icon=npm&color=blue" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://bundlephobia.com/result?p=material-react-table" target="_blank">
|
|
23
|
+
<img alt="" src="https://badgen.net/bundlephobia/minzip/material-react-table@latest?color=blue" />
|
|
24
|
+
</a>
|
|
25
|
+
<a href="https://star-history.com/#kevinvandy/material-react-table&Date" target="_blank">
|
|
26
|
+
<img alt="" src="https://badgen.net/github/stars/KevinVandy/material-react-table?color=blue" />
|
|
27
|
+
</a>
|
|
28
|
+
<a href="https://github.com/KevinVandy/material-react-table/blob/v3/LICENSE" target="_blank">
|
|
29
|
+
<img alt="" src="https://badgen.net/github/license/KevinVandy/material-react-table?color=blue" />
|
|
30
|
+
</a>
|
|
31
|
+
<a
|
|
32
|
+
href="https://github.com/sponsors/kevinvandy"
|
|
33
|
+
target="_blank"
|
|
34
|
+
rel="noopener"
|
|
35
|
+
>
|
|
36
|
+
<img alt="" src="https://img.shields.io/badge/sponsor-violet" />
|
|
37
|
+
</a>
|
|
38
|
+
<a
|
|
39
|
+
href="https://discord.gg/5wqyRx6fnm"
|
|
40
|
+
target="_blank"
|
|
41
|
+
rel="noopener"
|
|
42
|
+
>
|
|
43
|
+
<img alt="" src="https://dcbadge.vercel.app/api/server/5wqyRx6fnm?style=flat">
|
|
44
|
+
</a>
|
|
45
|
+
|
|
46
|
+
## About
|
|
47
|
+
|
|
48
|
+
### _Quickly Create React Data Tables with Material Design_
|
|
49
|
+
|
|
50
|
+
### **Built with [Material UI <sup>V9</sup>](https://mui.com) and [TanStack Table <sup>V8</sup>](https://tanstack.com/table/v8)**
|
|
51
|
+
|
|
52
|
+
<img src="https://material-react-table.com/banner.png" alt="MRT" height="50" />
|
|
53
|
+
|
|
54
|
+
> Want to use Mantine instead of Material UI? Check out [Mantine React Table](https://www.mantine-react-table.com)
|
|
55
|
+
|
|
56
|
+
## Learn More
|
|
57
|
+
|
|
58
|
+
- Join the [Discord](https://discord.gg/5wqyRx6fnm) server to join in on the development discussion or ask questions
|
|
59
|
+
- View the [Docs Website](https://www.material-react-table.com/)
|
|
60
|
+
- See all [Props, Options, APIs, Components, and Hooks](https://www.material-react-table.com/docs/api)
|
|
61
|
+
|
|
62
|
+
### Quick Examples
|
|
63
|
+
|
|
64
|
+
- [Basic Table](https://www.material-react-table.com/docs/examples/basic/) (See Default Features)
|
|
65
|
+
- [Minimal Table](https://www.material-react-table.com/docs/examples/minimal/) (Turn off Features like Pagination, Sorting, Filtering, and Toolbars)
|
|
66
|
+
- [Advanced Table](https://www.material-react-table.com/docs/examples/advanced/) (See some of the Advanced Features)
|
|
67
|
+
- [Custom Headless Table](https://www.material-react-table.com/docs/examples/custom-headless/) (Build your own table markup)
|
|
68
|
+
- [Dragging / Ordering Examples](https://www.material-react-table.com/docs/examples/column-ordering/) (Drag and Drop)
|
|
69
|
+
- [Editing (CRUD) Examples](https://www.material-react-table.com/docs/examples/editing-crud/) (Create, Edit, and Delete Rows)
|
|
70
|
+
- [Expanding / Grouping Examples](https://www.material-react-table.com/docs/examples/aggregation-and-grouping/) (Sum, Average, Count, etc.)
|
|
71
|
+
- [Filtering Examples](https://www.material-react-table.com/docs/examples/filter-variants/) (Faceted Values, Switching Filters, etc.)
|
|
72
|
+
- [Sticky Pinning Examples](https://www.material-react-table.com/docs/examples/sticky-header/) (Sticky Headers, Sticky Columns, Sticky Rows, etc.)
|
|
73
|
+
- [Remote Data Fetching Examples](https://www.material-react-table.com/docs/examples/react-query/) (Server-side Pagination, Sorting, and Filtering)
|
|
74
|
+
- [Virtualized Examples](https://www.material-react-table.com/docs/examples/virtualized/) (10,000 rows at once!)
|
|
75
|
+
- [Infinite Scrolling](https://www.material-react-table.com/docs/examples/infinite-scrolling/) (Fetch data as you scroll)
|
|
76
|
+
- [Localization (i18n)](https://www.material-react-table.com/docs/guides/localization#built-in-locale-examples) (Over a dozen languages built-in)
|
|
77
|
+
|
|
78
|
+
View additional [storybook examples](https://www.material-react-table.dev/)
|
|
79
|
+
|
|
80
|
+
## Features
|
|
81
|
+
|
|
82
|
+
_All features can easily be enabled/disabled_
|
|
83
|
+
|
|
84
|
+
_**Fully Fleshed out [Docs](https://www.material-react-table.com/docs/guides#guides) are available for all features**_
|
|
85
|
+
|
|
86
|
+
- [x] 30-56kb gzipped - [Bundlephobia](https://bundlephobia.com/package/material-react-table)
|
|
87
|
+
- [x] Advanced TypeScript Generics Support (TypeScript Optional)
|
|
88
|
+
- [x] Aggregation and Grouping (Sum, Average, Count, etc.)
|
|
89
|
+
- [x] Cell Actions (Right-click Context Menu)
|
|
90
|
+
- [x] Click To Copy Cell Values
|
|
91
|
+
- [x] Column Action Dropdown Menu
|
|
92
|
+
- [x] Column Hiding
|
|
93
|
+
- [x] Column Ordering via Drag'n'Drop
|
|
94
|
+
- [x] Column Pinning (Freeze Columns)
|
|
95
|
+
- [x] Column Resizing
|
|
96
|
+
- [x] Customize Icons
|
|
97
|
+
- [x] Customize Styling of internal Mui Components
|
|
98
|
+
- [x] Data Editing and Creating (5 different editing modes)
|
|
99
|
+
- [x] Density Toggle
|
|
100
|
+
- [x] Detail Panels (Expansion)
|
|
101
|
+
- [x] Faceted Value Generation for Filter Options
|
|
102
|
+
- [x] Filtering (supports client-side and server-side)
|
|
103
|
+
- [x] Filter Match Highlighting
|
|
104
|
+
- [x] Full Screen Mode
|
|
105
|
+
- [x] Global Filtering (Search across all columns, rank by best match)
|
|
106
|
+
- [x] Header Groups & Footers
|
|
107
|
+
- [x] Localization (i18n) support
|
|
108
|
+
- [x] Manage your own state or let the table manage it internally for you
|
|
109
|
+
- [x] Pagination (supports client-side and server-side)
|
|
110
|
+
- [x] Row Actions (Your Custom Action Buttons)
|
|
111
|
+
- [x] Row Numbers
|
|
112
|
+
- [x] Row Ordering via Drag'n'Drop
|
|
113
|
+
- [x] Row Pinning
|
|
114
|
+
- [x] Row Selection (Checkboxes)
|
|
115
|
+
- [x] SSR compatible
|
|
116
|
+
- [x] Sorting (supports client-side and server-side)
|
|
117
|
+
- [x] Theming (Respects your Material UI Theme)
|
|
118
|
+
- [x] Toolbars (Add your own action buttons)
|
|
119
|
+
- [x] Tree Data / Expanding Sub-rows
|
|
120
|
+
- [x] Virtualization (@tanstack/react-virtual)
|
|
121
|
+
|
|
122
|
+
## Getting Started
|
|
123
|
+
|
|
124
|
+
### Installation
|
|
125
|
+
|
|
126
|
+
View the full [Installation Docs](https://www.material-react-table.com/docs/getting-started/install)
|
|
127
|
+
|
|
128
|
+
1. Ensure that you have React 19 or later installed
|
|
129
|
+
|
|
130
|
+
2. Install Peer Dependencies (Material UI V9)
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npm install @mui/material @mui/x-date-pickers @mui/icons-material @emotion/react @emotion/styled
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
3. Install material-react-table
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npm install material-react-table
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
> _`@tanstack/react-table`, `@tanstack/react-virtual`, and `@tanstack/match-sorter-utils`_ are internal dependencies, so you do NOT need to install them yourself.
|
|
143
|
+
|
|
144
|
+
### Usage
|
|
145
|
+
|
|
146
|
+
> Read the full usage docs [here](https://www.material-react-table.com/docs/getting-started/usage/)
|
|
147
|
+
|
|
148
|
+
```jsx
|
|
149
|
+
import { useMemo, useState, useEffect } from 'react';
|
|
150
|
+
import {
|
|
151
|
+
MaterialReactTable,
|
|
152
|
+
useMaterialReactTable,
|
|
153
|
+
} from 'material-react-table';
|
|
154
|
+
|
|
155
|
+
//data must be stable reference (useState, useMemo, useQuery, defined outside of component, etc.)
|
|
156
|
+
const data = [
|
|
157
|
+
{
|
|
158
|
+
name: 'John',
|
|
159
|
+
age: 30,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'Sara',
|
|
163
|
+
age: 25,
|
|
164
|
+
},
|
|
165
|
+
];
|
|
166
|
+
|
|
167
|
+
export default function App() {
|
|
168
|
+
const columns = useMemo(
|
|
169
|
+
() => [
|
|
170
|
+
{
|
|
171
|
+
accessorKey: 'name', //simple recommended way to define a column
|
|
172
|
+
header: 'Name',
|
|
173
|
+
muiTableHeadCellProps: { sx: { color: 'green' } }, //optional custom props
|
|
174
|
+
Cell: ({ cell }) => <span>{cell.getValue()}</span>, //optional custom cell render
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
accessorFn: (row) => row.age, //alternate way
|
|
178
|
+
id: 'age', //id required if you use accessorFn instead of accessorKey
|
|
179
|
+
header: 'Age',
|
|
180
|
+
Header: () => <i>Age</i>, //optional custom header render
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
[],
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
//optionally, you can manage any/all of the table state yourself
|
|
187
|
+
const [rowSelection, setRowSelection] = useState({});
|
|
188
|
+
|
|
189
|
+
useEffect(() => {
|
|
190
|
+
//do something when the row selection changes
|
|
191
|
+
}, [rowSelection]);
|
|
192
|
+
|
|
193
|
+
const table = useMaterialReactTable({
|
|
194
|
+
columns,
|
|
195
|
+
data,
|
|
196
|
+
enableColumnOrdering: true, //enable some features
|
|
197
|
+
enableRowSelection: true,
|
|
198
|
+
enablePagination: false, //disable a default feature
|
|
199
|
+
onRowSelectionChange: setRowSelection, //hoist internal state to your own state (optional)
|
|
200
|
+
state: { rowSelection }, //manage your own state, pass it back to the table (optional)
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
const someEventHandler = () => {
|
|
204
|
+
//read the table state during an event from the table instance
|
|
205
|
+
console.log(table.getState().sorting);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<MaterialReactTable table={table} /> //other more lightweight MRT sub components also available
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
_Open in [Code Sandbox](https://codesandbox.io/s/simple-material-react-table-example-t5c3ji)_
|
|
215
|
+
|
|
216
|
+
## Contributors
|
|
217
|
+
|
|
218
|
+
<a href="https://github.com/kevinvandy/material-react-table/graphs/contributors">
|
|
219
|
+
<img src="https://contrib.rocks/image?repo=kevinvandy/material-react-table" />
|
|
220
|
+
</a>
|
|
221
|
+
|
|
222
|
+
PRs are Welcome, but please discuss in [GitHub Discussions](https://github.com/KevinVandy/material-react-table/discussions) or the [Discord Server](https://discord.gg/5wqyRx6fnm) first if it is a large change!
|
|
223
|
+
|
|
224
|
+
Read the [Contributing Guide](https://github.com/KevinVandy/material-react-table/blob/v3/CONTRIBUTING.md) to learn how to run this project locally.
|
|
225
|
+
|
|
226
|
+
<!-- Use the FORCE, Luke! -->
|
|
227
|
+
## About Novastera
|
|
228
|
+
|
|
229
|
+
**Material React Table V4** is maintained by **Novastera** as part of our commitment to the open-source community. This fork was established to ensure that one of the React table libraries remains compatible with the latest versions of Material UI and receives the active maintenance it deserves.
|
|
230
|
+
|
|
231
|
+
We step in where others stall—providing stability, modern dependency support, and a reliable path forward for production applications.
|
|
232
|
+
|
|
233
|
+
Learn more: [https://novastera.com/resources](https://novastera.com/resources)
|