@cutting/material-react-table 4.0.0

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.
Files changed (327) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +215 -0
  3. package/dist/index.d.ts +1876 -0
  4. package/dist/index.esm.js +4434 -0
  5. package/dist/index.esm.js.map +1 -0
  6. package/dist/index.js +4540 -0
  7. package/dist/index.js.map +1 -0
  8. package/locales/ar/index.d.ts +3 -0
  9. package/locales/ar/index.esm.d.ts +3 -0
  10. package/locales/ar/index.esm.js +96 -0
  11. package/locales/ar/index.js +98 -0
  12. package/locales/ar/package.json +6 -0
  13. package/locales/az/index.d.ts +3 -0
  14. package/locales/az/index.esm.d.ts +3 -0
  15. package/locales/az/index.esm.js +96 -0
  16. package/locales/az/index.js +98 -0
  17. package/locales/az/package.json +6 -0
  18. package/locales/bg/index.d.ts +3 -0
  19. package/locales/bg/index.esm.d.ts +3 -0
  20. package/locales/bg/index.esm.js +96 -0
  21. package/locales/bg/index.js +98 -0
  22. package/locales/bg/package.json +6 -0
  23. package/locales/cs/index.d.ts +3 -0
  24. package/locales/cs/index.esm.d.ts +3 -0
  25. package/locales/cs/index.esm.js +96 -0
  26. package/locales/cs/index.js +98 -0
  27. package/locales/cs/package.json +6 -0
  28. package/locales/da/index.d.ts +3 -0
  29. package/locales/da/index.esm.d.ts +3 -0
  30. package/locales/da/index.esm.js +96 -0
  31. package/locales/da/index.js +98 -0
  32. package/locales/da/package.json +6 -0
  33. package/locales/de/index.d.ts +3 -0
  34. package/locales/de/index.esm.d.ts +3 -0
  35. package/locales/de/index.esm.js +96 -0
  36. package/locales/de/index.js +98 -0
  37. package/locales/de/package.json +6 -0
  38. package/locales/el/index.d.ts +3 -0
  39. package/locales/el/index.esm.d.ts +3 -0
  40. package/locales/el/index.esm.js +96 -0
  41. package/locales/el/index.js +98 -0
  42. package/locales/el/package.json +6 -0
  43. package/locales/en/index.d.ts +3 -0
  44. package/locales/en/index.esm.d.ts +3 -0
  45. package/locales/en/index.esm.js +96 -0
  46. package/locales/en/index.js +98 -0
  47. package/locales/en/package.json +6 -0
  48. package/locales/es/index.d.ts +3 -0
  49. package/locales/es/index.esm.d.ts +3 -0
  50. package/locales/es/index.esm.js +96 -0
  51. package/locales/es/index.js +98 -0
  52. package/locales/es/package.json +6 -0
  53. package/locales/et/index.d.ts +3 -0
  54. package/locales/et/index.esm.d.ts +3 -0
  55. package/locales/et/index.esm.js +96 -0
  56. package/locales/et/index.js +98 -0
  57. package/locales/et/package.json +6 -0
  58. package/locales/fa/index.d.ts +3 -0
  59. package/locales/fa/index.esm.d.ts +3 -0
  60. package/locales/fa/index.esm.js +96 -0
  61. package/locales/fa/index.js +98 -0
  62. package/locales/fa/package.json +6 -0
  63. package/locales/fi/index.d.ts +3 -0
  64. package/locales/fi/index.esm.d.ts +3 -0
  65. package/locales/fi/index.esm.js +96 -0
  66. package/locales/fi/index.js +98 -0
  67. package/locales/fi/package.json +6 -0
  68. package/locales/fr/index.d.ts +3 -0
  69. package/locales/fr/index.esm.d.ts +3 -0
  70. package/locales/fr/index.esm.js +96 -0
  71. package/locales/fr/index.js +98 -0
  72. package/locales/fr/package.json +6 -0
  73. package/locales/he/index.d.ts +3 -0
  74. package/locales/he/index.esm.d.ts +3 -0
  75. package/locales/he/index.esm.js +96 -0
  76. package/locales/he/index.js +98 -0
  77. package/locales/he/package.json +6 -0
  78. package/locales/hr/index.d.ts +3 -0
  79. package/locales/hr/index.esm.d.ts +3 -0
  80. package/locales/hr/index.esm.js +96 -0
  81. package/locales/hr/index.js +98 -0
  82. package/locales/hr/package.json +6 -0
  83. package/locales/hu/index.d.ts +3 -0
  84. package/locales/hu/index.esm.d.ts +3 -0
  85. package/locales/hu/index.esm.js +96 -0
  86. package/locales/hu/index.js +98 -0
  87. package/locales/hu/package.json +6 -0
  88. package/locales/hy/index.d.ts +3 -0
  89. package/locales/hy/index.esm.d.ts +3 -0
  90. package/locales/hy/index.esm.js +96 -0
  91. package/locales/hy/index.js +98 -0
  92. package/locales/hy/package.json +6 -0
  93. package/locales/id/index.d.ts +3 -0
  94. package/locales/id/index.esm.d.ts +3 -0
  95. package/locales/id/index.esm.js +96 -0
  96. package/locales/id/index.js +98 -0
  97. package/locales/id/package.json +6 -0
  98. package/locales/it/index.d.ts +3 -0
  99. package/locales/it/index.esm.d.ts +3 -0
  100. package/locales/it/index.esm.js +96 -0
  101. package/locales/it/index.js +98 -0
  102. package/locales/it/package.json +6 -0
  103. package/locales/ja/index.d.ts +3 -0
  104. package/locales/ja/index.esm.d.ts +3 -0
  105. package/locales/ja/index.esm.js +96 -0
  106. package/locales/ja/index.js +98 -0
  107. package/locales/ja/package.json +6 -0
  108. package/locales/ko/index.d.ts +3 -0
  109. package/locales/ko/index.esm.d.ts +3 -0
  110. package/locales/ko/index.esm.js +96 -0
  111. package/locales/ko/index.js +98 -0
  112. package/locales/ko/package.json +6 -0
  113. package/locales/nl/index.d.ts +3 -0
  114. package/locales/nl/index.esm.d.ts +3 -0
  115. package/locales/nl/index.esm.js +96 -0
  116. package/locales/nl/index.js +98 -0
  117. package/locales/nl/package.json +6 -0
  118. package/locales/no/index.d.ts +3 -0
  119. package/locales/no/index.esm.d.ts +3 -0
  120. package/locales/no/index.esm.js +96 -0
  121. package/locales/no/index.js +98 -0
  122. package/locales/no/package.json +6 -0
  123. package/locales/np/index.d.ts +3 -0
  124. package/locales/np/index.esm.d.ts +3 -0
  125. package/locales/np/index.esm.js +96 -0
  126. package/locales/np/index.js +98 -0
  127. package/locales/np/package.json +6 -0
  128. package/locales/pl/index.d.ts +3 -0
  129. package/locales/pl/index.esm.d.ts +3 -0
  130. package/locales/pl/index.esm.js +96 -0
  131. package/locales/pl/index.js +98 -0
  132. package/locales/pl/package.json +6 -0
  133. package/locales/pt/index.d.ts +3 -0
  134. package/locales/pt/index.esm.d.ts +3 -0
  135. package/locales/pt/index.esm.js +96 -0
  136. package/locales/pt/index.js +98 -0
  137. package/locales/pt/package.json +6 -0
  138. package/locales/pt-BR/index.d.ts +3 -0
  139. package/locales/pt-BR/index.esm.d.ts +3 -0
  140. package/locales/pt-BR/index.esm.js +96 -0
  141. package/locales/pt-BR/index.js +98 -0
  142. package/locales/pt-BR/package.json +6 -0
  143. package/locales/ro/index.d.ts +3 -0
  144. package/locales/ro/index.esm.d.ts +3 -0
  145. package/locales/ro/index.esm.js +96 -0
  146. package/locales/ro/index.js +98 -0
  147. package/locales/ro/package.json +6 -0
  148. package/locales/ru/index.d.ts +3 -0
  149. package/locales/ru/index.esm.d.ts +3 -0
  150. package/locales/ru/index.esm.js +96 -0
  151. package/locales/ru/index.js +98 -0
  152. package/locales/ru/package.json +6 -0
  153. package/locales/sk/index.d.ts +3 -0
  154. package/locales/sk/index.esm.d.ts +3 -0
  155. package/locales/sk/index.esm.js +96 -0
  156. package/locales/sk/index.js +98 -0
  157. package/locales/sk/package.json +6 -0
  158. package/locales/sr-Cyrl-RS/index.d.ts +3 -0
  159. package/locales/sr-Cyrl-RS/index.esm.d.ts +3 -0
  160. package/locales/sr-Cyrl-RS/index.esm.js +96 -0
  161. package/locales/sr-Cyrl-RS/index.js +98 -0
  162. package/locales/sr-Cyrl-RS/package.json +6 -0
  163. package/locales/sr-Latn-RS/index.d.ts +3 -0
  164. package/locales/sr-Latn-RS/index.esm.d.ts +3 -0
  165. package/locales/sr-Latn-RS/index.esm.js +96 -0
  166. package/locales/sr-Latn-RS/index.js +98 -0
  167. package/locales/sr-Latn-RS/package.json +6 -0
  168. package/locales/sv/index.d.ts +3 -0
  169. package/locales/sv/index.esm.d.ts +3 -0
  170. package/locales/sv/index.esm.js +96 -0
  171. package/locales/sv/index.js +98 -0
  172. package/locales/sv/package.json +6 -0
  173. package/locales/tr/index.d.ts +3 -0
  174. package/locales/tr/index.esm.d.ts +3 -0
  175. package/locales/tr/index.esm.js +96 -0
  176. package/locales/tr/index.js +98 -0
  177. package/locales/tr/package.json +6 -0
  178. package/locales/uk/index.d.ts +3 -0
  179. package/locales/uk/index.esm.d.ts +3 -0
  180. package/locales/uk/index.esm.js +96 -0
  181. package/locales/uk/index.js +98 -0
  182. package/locales/uk/package.json +6 -0
  183. package/locales/vi/index.d.ts +3 -0
  184. package/locales/vi/index.esm.d.ts +3 -0
  185. package/locales/vi/index.esm.js +96 -0
  186. package/locales/vi/index.js +98 -0
  187. package/locales/vi/package.json +6 -0
  188. package/locales/zh-Hans/index.d.ts +3 -0
  189. package/locales/zh-Hans/index.esm.d.ts +3 -0
  190. package/locales/zh-Hans/index.esm.js +96 -0
  191. package/locales/zh-Hans/index.js +98 -0
  192. package/locales/zh-Hans/package.json +6 -0
  193. package/locales/zh-Hant/index.d.ts +3 -0
  194. package/locales/zh-Hant/index.esm.d.ts +3 -0
  195. package/locales/zh-Hant/index.esm.js +96 -0
  196. package/locales/zh-Hant/index.js +98 -0
  197. package/locales/zh-Hant/package.json +6 -0
  198. package/package.json +133 -0
  199. package/src/MaterialReactTable.smoke.test.tsx +56 -0
  200. package/src/components/MaterialReactTable.tsx +36 -0
  201. package/src/components/body/MRT_TableBody.tsx +222 -0
  202. package/src/components/body/MRT_TableBodyCell.tsx +352 -0
  203. package/src/components/body/MRT_TableBodyCellValue.tsx +131 -0
  204. package/src/components/body/MRT_TableBodyRow.tsx +283 -0
  205. package/src/components/body/MRT_TableBodyRowGrabHandle.tsx +62 -0
  206. package/src/components/body/MRT_TableBodyRowPinButton.tsx +59 -0
  207. package/src/components/body/MRT_TableDetailPanel.tsx +111 -0
  208. package/src/components/buttons/MRT_ColumnPinningButtons.tsx +73 -0
  209. package/src/components/buttons/MRT_CopyButton.tsx +88 -0
  210. package/src/components/buttons/MRT_EditActionButtons.tsx +135 -0
  211. package/src/components/buttons/MRT_ExpandAllButton.tsx +79 -0
  212. package/src/components/buttons/MRT_ExpandButton.tsx +103 -0
  213. package/src/components/buttons/MRT_GrabHandleButton.tsx +66 -0
  214. package/src/components/buttons/MRT_RowPinButton.tsx +85 -0
  215. package/src/components/buttons/MRT_ShowHideColumnsButton.tsx +51 -0
  216. package/src/components/buttons/MRT_ToggleDensePaddingButton.tsx +53 -0
  217. package/src/components/buttons/MRT_ToggleFiltersButton.tsx +41 -0
  218. package/src/components/buttons/MRT_ToggleFullScreenButton.tsx +52 -0
  219. package/src/components/buttons/MRT_ToggleGlobalFilterButton.tsx +47 -0
  220. package/src/components/buttons/MRT_ToggleRowActionMenuButton.tsx +127 -0
  221. package/src/components/footer/MRT_TableFooter.tsx +89 -0
  222. package/src/components/footer/MRT_TableFooterCell.tsx +108 -0
  223. package/src/components/footer/MRT_TableFooterRow.tsx +96 -0
  224. package/src/components/head/MRT_TableHead.tsx +92 -0
  225. package/src/components/head/MRT_TableHeadCell.tsx +352 -0
  226. package/src/components/head/MRT_TableHeadCellColumnActionsButton.tsx +97 -0
  227. package/src/components/head/MRT_TableHeadCellFilterContainer.tsx +53 -0
  228. package/src/components/head/MRT_TableHeadCellFilterLabel.tsx +179 -0
  229. package/src/components/head/MRT_TableHeadCellGrabHandle.tsx +92 -0
  230. package/src/components/head/MRT_TableHeadCellResizeHandle.tsx +97 -0
  231. package/src/components/head/MRT_TableHeadCellSortLabel.tsx +102 -0
  232. package/src/components/head/MRT_TableHeadRow.tsx +91 -0
  233. package/src/components/inputs/MRT_EditCellTextField.tsx +190 -0
  234. package/src/components/inputs/MRT_FilterCheckbox.tsx +91 -0
  235. package/src/components/inputs/MRT_FilterRangeFields.tsx +42 -0
  236. package/src/components/inputs/MRT_FilterRangeSlider.tsx +144 -0
  237. package/src/components/inputs/MRT_FilterTextField.tsx +599 -0
  238. package/src/components/inputs/MRT_GlobalFilterTextField.tsx +160 -0
  239. package/src/components/inputs/MRT_SelectCheckbox.tsx +136 -0
  240. package/src/components/menus/MRT_ActionMenuItem.tsx +63 -0
  241. package/src/components/menus/MRT_CellActionMenu.tsx +108 -0
  242. package/src/components/menus/MRT_ColumnActionMenu.tsx +353 -0
  243. package/src/components/menus/MRT_FilterOptionMenu.tsx +293 -0
  244. package/src/components/menus/MRT_RowActionMenu.tsx +89 -0
  245. package/src/components/menus/MRT_ShowHideColumnsMenu.tsx +180 -0
  246. package/src/components/menus/MRT_ShowHideColumnsMenuItems.tsx +204 -0
  247. package/src/components/modals/MRT_EditRowModal.tsx +115 -0
  248. package/src/components/table/MRT_Table.tsx +85 -0
  249. package/src/components/table/MRT_TableContainer.tsx +112 -0
  250. package/src/components/table/MRT_TableLoadingOverlay.tsx +59 -0
  251. package/src/components/table/MRT_TablePaper.tsx +90 -0
  252. package/src/components/toolbar/MRT_BottomToolbar.tsx +109 -0
  253. package/src/components/toolbar/MRT_LinearProgressBar.tsx +54 -0
  254. package/src/components/toolbar/MRT_TablePagination.tsx +244 -0
  255. package/src/components/toolbar/MRT_ToolbarAlertBanner.tsx +184 -0
  256. package/src/components/toolbar/MRT_ToolbarDropZone.tsx +81 -0
  257. package/src/components/toolbar/MRT_ToolbarInternalButtons.tsx +73 -0
  258. package/src/components/toolbar/MRT_TopToolbar.tsx +131 -0
  259. package/src/fns/aggregationFns.ts +3 -0
  260. package/src/fns/filterFns.ts +197 -0
  261. package/src/fns/sortingFns.ts +34 -0
  262. package/src/hooks/display-columns/getMRT_RowActionsColumnDef.tsx +28 -0
  263. package/src/hooks/display-columns/getMRT_RowDragColumnDef.tsx +30 -0
  264. package/src/hooks/display-columns/getMRT_RowExpandColumnDef.tsx +97 -0
  265. package/src/hooks/display-columns/getMRT_RowNumbersColumnDef.tsx +30 -0
  266. package/src/hooks/display-columns/getMRT_RowPinningColumnDef.tsx +24 -0
  267. package/src/hooks/display-columns/getMRT_RowSelectColumnDef.tsx +34 -0
  268. package/src/hooks/display-columns/getMRT_RowSpacerColumnDef.tsx +33 -0
  269. package/src/hooks/useMRT_ColumnVirtualizer.ts +125 -0
  270. package/src/hooks/useMRT_Effects.ts +107 -0
  271. package/src/hooks/useMRT_RowVirtualizer.ts +89 -0
  272. package/src/hooks/useMRT_Rows.ts +45 -0
  273. package/src/hooks/useMRT_TableInstance.ts +318 -0
  274. package/src/hooks/useMRT_TableOptions.ts +271 -0
  275. package/src/hooks/useMaterialReactTable.ts +12 -0
  276. package/src/icons.ts +73 -0
  277. package/src/index.ts +91 -0
  278. package/src/locales/ar.ts +97 -0
  279. package/src/locales/az.ts +97 -0
  280. package/src/locales/bg.ts +97 -0
  281. package/src/locales/cs.ts +98 -0
  282. package/src/locales/da.ts +97 -0
  283. package/src/locales/de.ts +97 -0
  284. package/src/locales/el.ts +97 -0
  285. package/src/locales/en.ts +97 -0
  286. package/src/locales/es.ts +97 -0
  287. package/src/locales/et.ts +98 -0
  288. package/src/locales/fa.ts +97 -0
  289. package/src/locales/fi.ts +98 -0
  290. package/src/locales/fr.ts +97 -0
  291. package/src/locales/he.ts +97 -0
  292. package/src/locales/hr.ts +97 -0
  293. package/src/locales/hu.ts +97 -0
  294. package/src/locales/hy.ts +97 -0
  295. package/src/locales/id.ts +98 -0
  296. package/src/locales/it.ts +97 -0
  297. package/src/locales/ja.ts +97 -0
  298. package/src/locales/ko.ts +97 -0
  299. package/src/locales/mk.ts +96 -0
  300. package/src/locales/nl.ts +97 -0
  301. package/src/locales/no.ts +99 -0
  302. package/src/locales/np.ts +98 -0
  303. package/src/locales/pl.ts +97 -0
  304. package/src/locales/pt-BR.ts +97 -0
  305. package/src/locales/pt.ts +97 -0
  306. package/src/locales/ro.ts +97 -0
  307. package/src/locales/ru.ts +97 -0
  308. package/src/locales/sk.ts +98 -0
  309. package/src/locales/sr-Cyrl-RS.ts +97 -0
  310. package/src/locales/sr-Latn-RS.ts +97 -0
  311. package/src/locales/sv.ts +97 -0
  312. package/src/locales/tr.ts +97 -0
  313. package/src/locales/uk.ts +97 -0
  314. package/src/locales/vi.ts +97 -0
  315. package/src/locales/zh-Hans.ts +96 -0
  316. package/src/locales/zh-Hant.ts +96 -0
  317. package/src/types.ts +1290 -0
  318. package/src/utils/cell.utils.ts +234 -0
  319. package/src/utils/column.utils.ts +210 -0
  320. package/src/utils/displayColumn.utils.ts +152 -0
  321. package/src/utils/row.utils.ts +261 -0
  322. package/src/utils/slotProps.utils.ts +25 -0
  323. package/src/utils/style.utils.ts +210 -0
  324. package/src/utils/tanstack.helpers.ts +65 -0
  325. package/src/utils/utils.ts +23 -0
  326. package/src/utils/virtualization.utils.ts +24 -0
  327. package/src/vitest.setup.ts +1 -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,215 @@
1
+ # Material React Table V3
2
+
3
+ View [Documentation](https://www.material-react-table.com/)
4
+
5
+ <a href="https://npmjs.com/package/material-react-table" target="_blank">
6
+ <img alt="" src="https://badgen.net/npm/v/material-react-table?color=blue" />
7
+ </a>
8
+ <a href="https://npmtrends.com/material-react-table" target="_blank">
9
+ <img alt="" src="https://badgen.net/npm/dt/material-react-table?label=installs&icon=npm&color=blue" />
10
+ </a>
11
+ <a href="https://bundlephobia.com/result?p=material-react-table" target="_blank">
12
+ <img alt="" src="https://badgen.net/bundlephobia/minzip/material-react-table@latest?color=blue" />
13
+ </a>
14
+ <a href="https://star-history.com/#kevinvandy/material-react-table&Date" target="_blank">
15
+ <img alt="" src="https://badgen.net/github/stars/KevinVandy/material-react-table?color=blue" />
16
+ </a>
17
+ <a href="https://github.com/KevinVandy/material-react-table/blob/v3/LICENSE" target="_blank">
18
+ <img alt="" src="https://badgen.net/github/license/KevinVandy/material-react-table?color=blue" />
19
+ </a>
20
+ <a
21
+ href="https://github.com/sponsors/kevinvandy"
22
+ target="_blank"
23
+ rel="noopener"
24
+ >
25
+ <img alt="" src="https://img.shields.io/badge/sponsor-violet" />
26
+ </a>
27
+ <a
28
+ href="https://discord.gg/5wqyRx6fnm"
29
+ target="_blank"
30
+ rel="noopener"
31
+ >
32
+ <img alt="" src="https://dcbadge.vercel.app/api/server/5wqyRx6fnm?style=flat">
33
+ </a>
34
+
35
+ ## About
36
+
37
+ ### _Quickly Create React Data Tables with Material Design_
38
+
39
+ ### **Built with [Material UI <sup>V6</sup>](https://mui.com) and [TanStack Table <sup>V8</sup>](https://tanstack.com/table/v8)**
40
+
41
+ <img src="https://material-react-table.com/banner.png" alt="MRT" height="50" />
42
+
43
+ > Want to use Mantine instead of Material UI? Check out [Mantine React Table](https://www.mantine-react-table.com)
44
+
45
+ ## Learn More
46
+
47
+ - Join the [Discord](https://discord.gg/5wqyRx6fnm) server to join in on the development discussion or ask questions
48
+ - View the [Docs Website](https://www.material-react-table.com/)
49
+ - See all [Props, Options, APIs, Components, and Hooks](https://www.material-react-table.com/docs/api)
50
+
51
+ ### Quick Examples
52
+
53
+ - [Basic Table](https://www.material-react-table.com/docs/examples/basic/) (See Default Features)
54
+ - [Minimal Table](https://www.material-react-table.com/docs/examples/minimal/) (Turn off Features like Pagination, Sorting, Filtering, and Toolbars)
55
+ - [Advanced Table](https://www.material-react-table.com/docs/examples/advanced/) (See some of the Advanced Features)
56
+ - [Custom Headless Table](https://www.material-react-table.com/docs/examples/custom-headless/) (Build your own table markup)
57
+ - [Dragging / Ordering Examples](https://www.material-react-table.com/docs/examples/column-ordering/) (Drag and Drop)
58
+ - [Editing (CRUD) Examples](https://www.material-react-table.com/docs/examples/editing-crud/) (Create, Edit, and Delete Rows)
59
+ - [Expanding / Grouping Examples](https://www.material-react-table.com/docs/examples/aggregation-and-grouping/) (Sum, Average, Count, etc.)
60
+ - [Filtering Examples](https://www.material-react-table.com/docs/examples/filter-variants/) (Faceted Values, Switching Filters, etc.)
61
+ - [Sticky Pinning Examples](https://www.material-react-table.com/docs/examples/sticky-header/) (Sticky Headers, Sticky Columns, Sticky Rows, etc.)
62
+ - [Remote Data Fetching Examples](https://www.material-react-table.com/docs/examples/react-query/) (Server-side Pagination, Sorting, and Filtering)
63
+ - [Virtualized Examples](https://www.material-react-table.com/docs/examples/virtualized/) (10,000 rows at once!)
64
+ - [Infinite Scrolling](https://www.material-react-table.com/docs/examples/infinite-scrolling/) (Fetch data as you scroll)
65
+ - [Localization (i18n)](https://www.material-react-table.com/docs/guides/localization#built-in-locale-examples) (Over a dozen languages built-in)
66
+
67
+ View additional [storybook examples](https://www.material-react-table.dev/)
68
+
69
+ ## Features
70
+
71
+ _All features can easily be enabled/disabled_
72
+
73
+ _**Fully Fleshed out [Docs](https://www.material-react-table.com/docs/guides#guides) are available for all features**_
74
+
75
+ - [x] 30-56kb gzipped - [Bundlephobia](https://bundlephobia.com/package/material-react-table)
76
+ - [x] Advanced TypeScript Generics Support (TypeScript Optional)
77
+ - [x] Aggregation and Grouping (Sum, Average, Count, etc.)
78
+ - [x] Cell Actions (Right-click Context Menu)
79
+ - [x] Click To Copy Cell Values
80
+ - [x] Column Action Dropdown Menu
81
+ - [x] Column Hiding
82
+ - [x] Column Ordering via Drag'n'Drop
83
+ - [x] Column Pinning (Freeze Columns)
84
+ - [x] Column Resizing
85
+ - [x] Customize Icons
86
+ - [x] Customize Styling of internal Mui Components
87
+ - [x] Data Editing and Creating (5 different editing modes)
88
+ - [x] Density Toggle
89
+ - [x] Detail Panels (Expansion)
90
+ - [x] Faceted Value Generation for Filter Options
91
+ - [x] Filtering (supports client-side and server-side)
92
+ - [x] Filter Match Highlighting
93
+ - [x] Full Screen Mode
94
+ - [x] Global Filtering (Search across all columns, rank by best match)
95
+ - [x] Header Groups & Footers
96
+ - [x] Localization (i18n) support
97
+ - [x] Manage your own state or let the table manage it internally for you
98
+ - [x] Pagination (supports client-side and server-side)
99
+ - [x] Row Actions (Your Custom Action Buttons)
100
+ - [x] Row Numbers
101
+ - [x] Row Ordering via Drag'n'Drop
102
+ - [x] Row Pinning
103
+ - [x] Row Selection (Checkboxes)
104
+ - [x] SSR compatible
105
+ - [x] Sorting (supports client-side and server-side)
106
+ - [x] Theming (Respects your Material UI Theme)
107
+ - [x] Toolbars (Add your own action buttons)
108
+ - [x] Tree Data / Expanding Sub-rows
109
+ - [x] Virtualization (@tanstack/react-virtual)
110
+
111
+ ## Getting Started
112
+
113
+ ### Installation
114
+
115
+ View the full [Installation Docs](https://www.material-react-table.com/docs/getting-started/install)
116
+
117
+ 1. Ensure that you have React 18 or later installed
118
+
119
+ 2. Install Peer Dependencies (Material UI V6)
120
+
121
+ ```bash
122
+ npm install @mui/material @mui/x-date-pickers @mui/icons-material @emotion/react @emotion/styled
123
+ ```
124
+
125
+ 3. Install material-react-table
126
+
127
+ ```bash
128
+ npm install material-react-table
129
+ ```
130
+
131
+ > _`@tanstack/react-table`, `@tanstack/react-virtual`, and `@tanstack/match-sorter-utils`_ are internal dependencies, so you do NOT need to install them yourself.
132
+
133
+ ### Usage
134
+
135
+ > Read the full usage docs [here](https://www.material-react-table.com/docs/getting-started/usage/)
136
+
137
+ ```jsx
138
+ import { useMemo, useState, useEffect } from 'react';
139
+ import {
140
+ MaterialReactTable,
141
+ useMaterialReactTable,
142
+ } from 'material-react-table';
143
+
144
+ //data must be stable reference (useState, useMemo, useQuery, defined outside of component, etc.)
145
+ const data = [
146
+ {
147
+ name: 'John',
148
+ age: 30,
149
+ },
150
+ {
151
+ name: 'Sara',
152
+ age: 25,
153
+ },
154
+ ];
155
+
156
+ export default function App() {
157
+ const columns = useMemo(
158
+ () => [
159
+ {
160
+ accessorKey: 'name', //simple recommended way to define a column
161
+ header: 'Name',
162
+ muiTableHeadCellProps: { sx: { color: 'green' } }, //optional custom props
163
+ Cell: ({ cell }) => <span>{cell.getValue()}</span>, //optional custom cell render
164
+ },
165
+ {
166
+ accessorFn: (row) => row.age, //alternate way
167
+ id: 'age', //id required if you use accessorFn instead of accessorKey
168
+ header: 'Age',
169
+ Header: () => <i>Age</i>, //optional custom header render
170
+ },
171
+ ],
172
+ [],
173
+ );
174
+
175
+ //optionally, you can manage any/all of the table state yourself
176
+ const [rowSelection, setRowSelection] = useState({});
177
+
178
+ useEffect(() => {
179
+ //do something when the row selection changes
180
+ }, [rowSelection]);
181
+
182
+ const table = useMaterialReactTable({
183
+ columns,
184
+ data,
185
+ enableColumnOrdering: true, //enable some features
186
+ enableRowSelection: true,
187
+ enablePagination: false, //disable a default feature
188
+ onRowSelectionChange: setRowSelection, //hoist internal state to your own state (optional)
189
+ state: { rowSelection }, //manage your own state, pass it back to the table (optional)
190
+ });
191
+
192
+ const someEventHandler = () => {
193
+ //read the table state during an event from the table instance
194
+ console.log(table.getState().sorting);
195
+ };
196
+
197
+ return (
198
+ <MaterialReactTable table={table} /> //other more lightweight MRT sub components also available
199
+ );
200
+ }
201
+ ```
202
+
203
+ _Open in [Code Sandbox](https://codesandbox.io/s/simple-material-react-table-example-t5c3ji)_
204
+
205
+ ## Contributors
206
+
207
+ <a href="https://github.com/kevinvandy/material-react-table/graphs/contributors">
208
+ <img src="https://contrib.rocks/image?repo=kevinvandy/material-react-table" />
209
+ </a>
210
+
211
+ 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!
212
+
213
+ Read the [Contributing Guide](https://github.com/KevinVandy/material-react-table/blob/v3/CONTRIBUTING.md) to learn how to run this project locally.
214
+
215
+ <!-- Use the FORCE, Luke! -->