@lminii/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 (349) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +234 -0
  3. package/dist/index.d.mts +2408 -0
  4. package/dist/index.d.ts +2408 -0
  5. package/dist/index.js +4825 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.mjs +4631 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/locales/ar/index.d.mts +3 -0
  10. package/locales/ar/index.d.ts +3 -0
  11. package/locales/ar/index.js +100 -0
  12. package/locales/ar/index.mjs +96 -0
  13. package/locales/ar/package.json +6 -0
  14. package/locales/az/index.d.mts +3 -0
  15. package/locales/az/index.d.ts +3 -0
  16. package/locales/az/index.js +100 -0
  17. package/locales/az/index.mjs +96 -0
  18. package/locales/az/package.json +6 -0
  19. package/locales/bg/index.d.mts +3 -0
  20. package/locales/bg/index.d.ts +3 -0
  21. package/locales/bg/index.js +100 -0
  22. package/locales/bg/index.mjs +96 -0
  23. package/locales/bg/package.json +6 -0
  24. package/locales/cs/index.d.mts +3 -0
  25. package/locales/cs/index.d.ts +3 -0
  26. package/locales/cs/index.js +100 -0
  27. package/locales/cs/index.mjs +96 -0
  28. package/locales/cs/package.json +6 -0
  29. package/locales/da/index.d.mts +3 -0
  30. package/locales/da/index.d.ts +3 -0
  31. package/locales/da/index.js +100 -0
  32. package/locales/da/index.mjs +96 -0
  33. package/locales/da/package.json +6 -0
  34. package/locales/de/index.d.mts +3 -0
  35. package/locales/de/index.d.ts +3 -0
  36. package/locales/de/index.js +100 -0
  37. package/locales/de/index.mjs +96 -0
  38. package/locales/de/package.json +6 -0
  39. package/locales/el/index.d.mts +3 -0
  40. package/locales/el/index.d.ts +3 -0
  41. package/locales/el/index.js +100 -0
  42. package/locales/el/index.mjs +96 -0
  43. package/locales/el/package.json +6 -0
  44. package/locales/en/index.d.mts +3 -0
  45. package/locales/en/index.d.ts +3 -0
  46. package/locales/en/index.js +100 -0
  47. package/locales/en/index.mjs +96 -0
  48. package/locales/en/package.json +6 -0
  49. package/locales/es/index.d.mts +3 -0
  50. package/locales/es/index.d.ts +3 -0
  51. package/locales/es/index.js +100 -0
  52. package/locales/es/index.mjs +96 -0
  53. package/locales/es/package.json +6 -0
  54. package/locales/et/index.d.mts +3 -0
  55. package/locales/et/index.d.ts +3 -0
  56. package/locales/et/index.js +100 -0
  57. package/locales/et/index.mjs +96 -0
  58. package/locales/et/package.json +6 -0
  59. package/locales/fa/index.d.mts +3 -0
  60. package/locales/fa/index.d.ts +3 -0
  61. package/locales/fa/index.js +100 -0
  62. package/locales/fa/index.mjs +96 -0
  63. package/locales/fa/package.json +6 -0
  64. package/locales/fi/index.d.mts +3 -0
  65. package/locales/fi/index.d.ts +3 -0
  66. package/locales/fi/index.js +100 -0
  67. package/locales/fi/index.mjs +96 -0
  68. package/locales/fi/package.json +6 -0
  69. package/locales/fr/index.d.mts +3 -0
  70. package/locales/fr/index.d.ts +3 -0
  71. package/locales/fr/index.js +100 -0
  72. package/locales/fr/index.mjs +96 -0
  73. package/locales/fr/package.json +6 -0
  74. package/locales/he/index.d.mts +3 -0
  75. package/locales/he/index.d.ts +3 -0
  76. package/locales/he/index.js +100 -0
  77. package/locales/he/index.mjs +96 -0
  78. package/locales/he/package.json +6 -0
  79. package/locales/hr/index.d.mts +3 -0
  80. package/locales/hr/index.d.ts +3 -0
  81. package/locales/hr/index.js +100 -0
  82. package/locales/hr/index.mjs +96 -0
  83. package/locales/hr/package.json +6 -0
  84. package/locales/hu/index.d.mts +3 -0
  85. package/locales/hu/index.d.ts +3 -0
  86. package/locales/hu/index.js +100 -0
  87. package/locales/hu/index.mjs +96 -0
  88. package/locales/hu/package.json +6 -0
  89. package/locales/hy/index.d.mts +3 -0
  90. package/locales/hy/index.d.ts +3 -0
  91. package/locales/hy/index.js +100 -0
  92. package/locales/hy/index.mjs +96 -0
  93. package/locales/hy/package.json +6 -0
  94. package/locales/id/index.d.mts +3 -0
  95. package/locales/id/index.d.ts +3 -0
  96. package/locales/id/index.js +100 -0
  97. package/locales/id/index.mjs +96 -0
  98. package/locales/id/package.json +6 -0
  99. package/locales/it/index.d.mts +3 -0
  100. package/locales/it/index.d.ts +3 -0
  101. package/locales/it/index.js +100 -0
  102. package/locales/it/index.mjs +96 -0
  103. package/locales/it/package.json +6 -0
  104. package/locales/ja/index.d.mts +3 -0
  105. package/locales/ja/index.d.ts +3 -0
  106. package/locales/ja/index.js +100 -0
  107. package/locales/ja/index.mjs +96 -0
  108. package/locales/ja/package.json +6 -0
  109. package/locales/ko/index.d.mts +3 -0
  110. package/locales/ko/index.d.ts +3 -0
  111. package/locales/ko/index.js +100 -0
  112. package/locales/ko/index.mjs +96 -0
  113. package/locales/ko/package.json +6 -0
  114. package/locales/nl/index.d.mts +3 -0
  115. package/locales/nl/index.d.ts +3 -0
  116. package/locales/nl/index.js +100 -0
  117. package/locales/nl/index.mjs +96 -0
  118. package/locales/nl/package.json +6 -0
  119. package/locales/no/index.d.mts +3 -0
  120. package/locales/no/index.d.ts +3 -0
  121. package/locales/no/index.js +100 -0
  122. package/locales/no/index.mjs +96 -0
  123. package/locales/no/package.json +6 -0
  124. package/locales/np/index.d.mts +3 -0
  125. package/locales/np/index.d.ts +3 -0
  126. package/locales/np/index.js +100 -0
  127. package/locales/np/index.mjs +96 -0
  128. package/locales/np/package.json +6 -0
  129. package/locales/pl/index.d.mts +3 -0
  130. package/locales/pl/index.d.ts +3 -0
  131. package/locales/pl/index.js +100 -0
  132. package/locales/pl/index.mjs +96 -0
  133. package/locales/pl/package.json +6 -0
  134. package/locales/pt/index.d.mts +3 -0
  135. package/locales/pt/index.d.ts +3 -0
  136. package/locales/pt/index.js +100 -0
  137. package/locales/pt/index.mjs +96 -0
  138. package/locales/pt/package.json +6 -0
  139. package/locales/pt-BR/index.d.mts +3 -0
  140. package/locales/pt-BR/index.d.ts +3 -0
  141. package/locales/pt-BR/index.js +100 -0
  142. package/locales/pt-BR/index.mjs +96 -0
  143. package/locales/pt-BR/package.json +6 -0
  144. package/locales/ro/index.d.mts +3 -0
  145. package/locales/ro/index.d.ts +3 -0
  146. package/locales/ro/index.js +100 -0
  147. package/locales/ro/index.mjs +96 -0
  148. package/locales/ro/package.json +6 -0
  149. package/locales/ru/index.d.mts +3 -0
  150. package/locales/ru/index.d.ts +3 -0
  151. package/locales/ru/index.js +100 -0
  152. package/locales/ru/index.mjs +96 -0
  153. package/locales/ru/package.json +6 -0
  154. package/locales/sk/index.d.mts +3 -0
  155. package/locales/sk/index.d.ts +3 -0
  156. package/locales/sk/index.js +100 -0
  157. package/locales/sk/index.mjs +96 -0
  158. package/locales/sk/package.json +6 -0
  159. package/locales/sr-Cyrl-RS/index.d.mts +3 -0
  160. package/locales/sr-Cyrl-RS/index.d.ts +3 -0
  161. package/locales/sr-Cyrl-RS/index.js +100 -0
  162. package/locales/sr-Cyrl-RS/index.mjs +96 -0
  163. package/locales/sr-Cyrl-RS/package.json +6 -0
  164. package/locales/sr-Latn-RS/index.d.mts +3 -0
  165. package/locales/sr-Latn-RS/index.d.ts +3 -0
  166. package/locales/sr-Latn-RS/index.js +100 -0
  167. package/locales/sr-Latn-RS/index.mjs +96 -0
  168. package/locales/sr-Latn-RS/package.json +6 -0
  169. package/locales/sv/index.d.mts +3 -0
  170. package/locales/sv/index.d.ts +3 -0
  171. package/locales/sv/index.js +100 -0
  172. package/locales/sv/index.mjs +96 -0
  173. package/locales/sv/package.json +6 -0
  174. package/locales/tr/index.d.mts +3 -0
  175. package/locales/tr/index.d.ts +3 -0
  176. package/locales/tr/index.js +100 -0
  177. package/locales/tr/index.mjs +96 -0
  178. package/locales/tr/package.json +6 -0
  179. package/locales/uk/index.d.mts +3 -0
  180. package/locales/uk/index.d.ts +3 -0
  181. package/locales/uk/index.js +100 -0
  182. package/locales/uk/index.mjs +96 -0
  183. package/locales/uk/package.json +6 -0
  184. package/locales/vi/index.d.mts +3 -0
  185. package/locales/vi/index.d.ts +3 -0
  186. package/locales/vi/index.js +100 -0
  187. package/locales/vi/index.mjs +96 -0
  188. package/locales/vi/package.json +6 -0
  189. package/locales/zh-Hans/index.d.mts +3 -0
  190. package/locales/zh-Hans/index.d.ts +3 -0
  191. package/locales/zh-Hans/index.js +100 -0
  192. package/locales/zh-Hans/index.mjs +96 -0
  193. package/locales/zh-Hans/package.json +6 -0
  194. package/locales/zh-Hant/index.d.mts +3 -0
  195. package/locales/zh-Hant/index.d.ts +3 -0
  196. package/locales/zh-Hant/index.js +100 -0
  197. package/locales/zh-Hant/index.mjs +96 -0
  198. package/locales/zh-Hant/package.json +6 -0
  199. package/package.json +147 -0
  200. package/skills/README.md +81 -0
  201. package/skills/composable-components/SKILL.md +189 -0
  202. package/skills/customization/SKILL.md +190 -0
  203. package/skills/drag-and-drop-ordering/SKILL.md +227 -0
  204. package/skills/editing/SKILL.md +243 -0
  205. package/skills/filtering/SKILL.md +213 -0
  206. package/skills/getting-started/SKILL.md +213 -0
  207. package/skills/localization/SKILL.md +182 -0
  208. package/skills/migrate-v3-to-v4/SKILL.md +161 -0
  209. package/skills/state-and-server-data/SKILL.md +200 -0
  210. package/skills/virtualization/SKILL.md +203 -0
  211. package/src/components/MaterialReactTable.tsx +36 -0
  212. package/src/components/body/MRT_TableBody.tsx +221 -0
  213. package/src/components/body/MRT_TableBodyCell.tsx +351 -0
  214. package/src/components/body/MRT_TableBodyCellValue.tsx +130 -0
  215. package/src/components/body/MRT_TableBodyRow.tsx +288 -0
  216. package/src/components/body/MRT_TableBodyRowGrabHandle.tsx +61 -0
  217. package/src/components/body/MRT_TableBodyRowPinButton.tsx +58 -0
  218. package/src/components/body/MRT_TableDetailPanel.tsx +110 -0
  219. package/src/components/buttons/MRT_ColumnPinningButtons.tsx +72 -0
  220. package/src/components/buttons/MRT_CopyButton.tsx +87 -0
  221. package/src/components/buttons/MRT_EditActionButtons.tsx +134 -0
  222. package/src/components/buttons/MRT_ExpandAllButton.tsx +78 -0
  223. package/src/components/buttons/MRT_ExpandButton.tsx +102 -0
  224. package/src/components/buttons/MRT_GrabHandleButton.tsx +65 -0
  225. package/src/components/buttons/MRT_RowPinButton.tsx +84 -0
  226. package/src/components/buttons/MRT_ShowHideColumnsButton.tsx +50 -0
  227. package/src/components/buttons/MRT_ToggleDensePaddingButton.tsx +52 -0
  228. package/src/components/buttons/MRT_ToggleFiltersButton.tsx +40 -0
  229. package/src/components/buttons/MRT_ToggleFullScreenButton.tsx +51 -0
  230. package/src/components/buttons/MRT_ToggleGlobalFilterButton.tsx +46 -0
  231. package/src/components/buttons/MRT_ToggleRowActionMenuButton.tsx +126 -0
  232. package/src/components/footer/MRT_TableFooter.tsx +88 -0
  233. package/src/components/footer/MRT_TableFooterCell.tsx +107 -0
  234. package/src/components/footer/MRT_TableFooterRow.tsx +95 -0
  235. package/src/components/head/MRT_TableHead.tsx +91 -0
  236. package/src/components/head/MRT_TableHeadCell.tsx +351 -0
  237. package/src/components/head/MRT_TableHeadCellColumnActionsButton.tsx +96 -0
  238. package/src/components/head/MRT_TableHeadCellFilterContainer.tsx +52 -0
  239. package/src/components/head/MRT_TableHeadCellFilterLabel.tsx +178 -0
  240. package/src/components/head/MRT_TableHeadCellGrabHandle.tsx +91 -0
  241. package/src/components/head/MRT_TableHeadCellResizeHandle.tsx +96 -0
  242. package/src/components/head/MRT_TableHeadCellSortLabel.tsx +101 -0
  243. package/src/components/head/MRT_TableHeadRow.tsx +90 -0
  244. package/src/components/inputs/MRT_EditCellTextField.tsx +202 -0
  245. package/src/components/inputs/MRT_FilterCheckbox.tsx +90 -0
  246. package/src/components/inputs/MRT_FilterRangeFields.tsx +41 -0
  247. package/src/components/inputs/MRT_FilterRangeSlider.tsx +143 -0
  248. package/src/components/inputs/MRT_FilterTextField.tsx +592 -0
  249. package/src/components/inputs/MRT_GlobalFilterTextField.tsx +167 -0
  250. package/src/components/inputs/MRT_SelectCheckbox.tsx +135 -0
  251. package/src/components/menus/MRT_ActionMenuItem.tsx +62 -0
  252. package/src/components/menus/MRT_CellActionMenu.tsx +107 -0
  253. package/src/components/menus/MRT_ColumnActionMenu.tsx +352 -0
  254. package/src/components/menus/MRT_FilterOptionMenu.tsx +292 -0
  255. package/src/components/menus/MRT_RowActionMenu.tsx +88 -0
  256. package/src/components/menus/MRT_ShowHideColumnsMenu.tsx +181 -0
  257. package/src/components/menus/MRT_ShowHideColumnsMenuItems.tsx +203 -0
  258. package/src/components/modals/MRT_EditRowModal.tsx +114 -0
  259. package/src/components/table/MRT_Table.tsx +84 -0
  260. package/src/components/table/MRT_TableContainer.tsx +111 -0
  261. package/src/components/table/MRT_TableLoadingOverlay.tsx +58 -0
  262. package/src/components/table/MRT_TablePaper.tsx +89 -0
  263. package/src/components/toolbar/MRT_BottomToolbar.tsx +111 -0
  264. package/src/components/toolbar/MRT_LinearProgressBar.tsx +53 -0
  265. package/src/components/toolbar/MRT_TablePagination.tsx +241 -0
  266. package/src/components/toolbar/MRT_ToolbarAlertBanner.tsx +184 -0
  267. package/src/components/toolbar/MRT_ToolbarDropZone.tsx +83 -0
  268. package/src/components/toolbar/MRT_ToolbarInternalButtons.tsx +72 -0
  269. package/src/components/toolbar/MRT_TopToolbar.tsx +130 -0
  270. package/src/features/mrtCellActionsFeature.ts +67 -0
  271. package/src/features/mrtColumnDraggingFeature.ts +83 -0
  272. package/src/features/mrtDensityFeature.ts +64 -0
  273. package/src/features/mrtEditingFeature.ts +102 -0
  274. package/src/features/mrtFeatures.ts +103 -0
  275. package/src/features/mrtFilterModesFeature.ts +99 -0
  276. package/src/features/mrtFnsFeature.ts +46 -0
  277. package/src/features/mrtFullScreenFeature.ts +63 -0
  278. package/src/features/mrtLoadingFeature.ts +35 -0
  279. package/src/features/mrtRefsFeature.ts +60 -0
  280. package/src/features/mrtRowDraggingFeature.ts +81 -0
  281. package/src/features/mrtStateCompatFeature.ts +43 -0
  282. package/src/features/mrtToolbarsFeature.ts +76 -0
  283. package/src/fns/aggregationFns.ts +3 -0
  284. package/src/fns/filterFns.ts +196 -0
  285. package/src/fns/sortingFns.ts +31 -0
  286. package/src/hooks/display-columns/getMRT_RowActionsColumnDef.tsx +28 -0
  287. package/src/hooks/display-columns/getMRT_RowDragColumnDef.tsx +29 -0
  288. package/src/hooks/display-columns/getMRT_RowExpandColumnDef.tsx +97 -0
  289. package/src/hooks/display-columns/getMRT_RowNumbersColumnDef.tsx +30 -0
  290. package/src/hooks/display-columns/getMRT_RowPinningColumnDef.tsx +24 -0
  291. package/src/hooks/display-columns/getMRT_RowSelectColumnDef.tsx +34 -0
  292. package/src/hooks/display-columns/getMRT_RowSpacerColumnDef.tsx +33 -0
  293. package/src/hooks/useMRT_ColumnVirtualizer.ts +124 -0
  294. package/src/hooks/useMRT_Effects.ts +108 -0
  295. package/src/hooks/useMRT_RowVirtualizer.ts +88 -0
  296. package/src/hooks/useMRT_Rows.ts +44 -0
  297. package/src/hooks/useMRT_TableInstance.ts +181 -0
  298. package/src/hooks/useMRT_TableOptions.ts +241 -0
  299. package/src/hooks/useMaterialReactTable.ts +12 -0
  300. package/src/icons.ts +73 -0
  301. package/src/index.ts +91 -0
  302. package/src/locales/ar.ts +97 -0
  303. package/src/locales/az.ts +97 -0
  304. package/src/locales/bg.ts +97 -0
  305. package/src/locales/cs.ts +98 -0
  306. package/src/locales/da.ts +97 -0
  307. package/src/locales/de.ts +97 -0
  308. package/src/locales/el.ts +97 -0
  309. package/src/locales/en.ts +97 -0
  310. package/src/locales/es.ts +97 -0
  311. package/src/locales/et.ts +98 -0
  312. package/src/locales/fa.ts +97 -0
  313. package/src/locales/fi.ts +98 -0
  314. package/src/locales/fr.ts +97 -0
  315. package/src/locales/he.ts +97 -0
  316. package/src/locales/hr.ts +97 -0
  317. package/src/locales/hu.ts +97 -0
  318. package/src/locales/hy.ts +97 -0
  319. package/src/locales/id.ts +98 -0
  320. package/src/locales/it.ts +97 -0
  321. package/src/locales/ja.ts +97 -0
  322. package/src/locales/ko.ts +97 -0
  323. package/src/locales/mk.ts +96 -0
  324. package/src/locales/nl.ts +97 -0
  325. package/src/locales/no.ts +99 -0
  326. package/src/locales/np.ts +98 -0
  327. package/src/locales/pl.ts +97 -0
  328. package/src/locales/pt-BR.ts +97 -0
  329. package/src/locales/pt.ts +97 -0
  330. package/src/locales/ro.ts +97 -0
  331. package/src/locales/ru.ts +97 -0
  332. package/src/locales/sk.ts +98 -0
  333. package/src/locales/sr-Cyrl-RS.ts +97 -0
  334. package/src/locales/sr-Latn-RS.ts +97 -0
  335. package/src/locales/sv.ts +97 -0
  336. package/src/locales/tr.ts +97 -0
  337. package/src/locales/uk.ts +97 -0
  338. package/src/locales/vi.ts +97 -0
  339. package/src/locales/zh-Hans.ts +96 -0
  340. package/src/locales/zh-Hant.ts +96 -0
  341. package/src/types.ts +1314 -0
  342. package/src/utils/cell.utils.ts +234 -0
  343. package/src/utils/column.utils.ts +204 -0
  344. package/src/utils/displayColumn.utils.ts +152 -0
  345. package/src/utils/row.utils.ts +258 -0
  346. package/src/utils/style.utils.ts +211 -0
  347. package/src/utils/tanstack.helpers.ts +64 -0
  348. package/src/utils/utils.ts +34 -0
  349. package/src/utils/virtualization.utils.ts +24 -0
@@ -0,0 +1,189 @@
1
+ ---
2
+ name: composable-components
3
+ description: >
4
+ Compose a custom Material React Table V4 layout from exported MRT_* components that all take the same table prop: MRT_TablePaper, MRT_TableContainer, MRT_Table, MRT_TopToolbar, MRT_TablePagination, MRT_GlobalFilterTextField, MRT_ToolbarInternalButtons, MRT_ShowHideColumnsButton, and MRT_TableBodyCellValue for fully custom markup. Load for tables inside cards or dialogs, toolbars placed outside the table, split layouts, or headless rendering with MRT state.
5
+ metadata:
6
+ type: framework
7
+ library: '@lminii/material-react-table'
8
+ library_version: '4.0.0'
9
+ framework: react
10
+ requires:
11
+ - getting-started
12
+ sources:
13
+ - 'lminii/material-react-table:apps/material-react-table-docs/pages/docs/api/mrt-components.mdx'
14
+ - 'lminii/material-react-table:apps/material-react-table-docs/examples/custom-headless/sandbox/src/TS.tsx'
15
+ - 'lminii/material-react-table:apps/material-react-table-docs/examples/custom-top-toolbar/sandbox/src/TS.tsx'
16
+ - 'lminii/material-react-table:apps/material-react-table-docs/examples/external-toolbar/sandbox/src/TS.tsx'
17
+ - 'lminii/material-react-table:packages/material-react-table/src/index.ts'
18
+ ---
19
+
20
+ This skill builds on `getting-started`. `MaterialReactTable` is a thin composition of exported sub-components. Because every sub-component takes the same `table` instance as a prop, you can render any subset of them anywhere in your tree while MRT keeps managing state.
21
+
22
+ ## Setup
23
+
24
+ ```tsx
25
+ import {
26
+ MRT_GlobalFilterTextField,
27
+ MRT_TableContainer,
28
+ MRT_TablePagination,
29
+ MRT_ToggleFiltersButton,
30
+ useMaterialReactTable,
31
+ } from '@lminii/material-react-table'
32
+
33
+ const table = useMaterialReactTable({ columns, data, enableBottomToolbar: false })
34
+
35
+ return (
36
+ <Card>
37
+ <CardHeader
38
+ title="People"
39
+ action={
40
+ <Stack direction="row" gap={1}>
41
+ <MRT_GlobalFilterTextField table={table} />
42
+ <MRT_ToggleFiltersButton table={table} />
43
+ </Stack>
44
+ }
45
+ />
46
+ <MRT_TableContainer table={table} />
47
+ <CardActions sx={{ justifyContent: 'flex-end' }}>
48
+ <MRT_TablePagination table={table} />
49
+ </CardActions>
50
+ </Card>
51
+ )
52
+ ```
53
+
54
+ `MRT_TableContainer` renders the scroll container, the table, the loading overlay, the edit row modal, and the cell action menu. Turn off the built-in toolbars with `enableTopToolbar` and `enableBottomToolbar` when you place their pieces elsewhere.
55
+
56
+ ## Core Patterns
57
+
58
+ ### Layers of the default component
59
+
60
+ ```text
61
+ MRT_TablePaper
62
+ MRT_TopToolbar
63
+ MRT_GlobalFilterTextField, MRT_ToolbarInternalButtons, MRT_ToolbarAlertBanner, MRT_TablePagination
64
+ MRT_TableContainer
65
+ MRT_Table
66
+ MRT_TableHead > MRT_TableHeadRow > MRT_TableHeadCell
67
+ MRT_TableBody > MRT_TableBodyRow > MRT_TableBodyCell, MRT_TableDetailPanel
68
+ MRT_TableFooter > MRT_TableFooterRow > MRT_TableFooterCell
69
+ MRT_BottomToolbar
70
+ ```
71
+
72
+ Start from the layer just above what you need to change. Replacing `MRT_TopToolbar` with your own component is the most common cut; replacing `MRT_TableBodyRow` is rarely worth it because `muiTableBodyRowProps` covers styling and events.
73
+
74
+ ### Toolbar buttons are individual exports
75
+
76
+ ```tsx
77
+ import {
78
+ MRT_ShowHideColumnsButton,
79
+ MRT_ToggleDensePaddingButton,
80
+ MRT_ToggleFullScreenButton,
81
+ } from '@lminii/material-react-table'
82
+
83
+ <MRT_ShowHideColumnsButton table={table} />
84
+ <MRT_ToggleDensePaddingButton table={table} />
85
+ <MRT_ToggleFullScreenButton table={table} />
86
+ ```
87
+
88
+ Each button reads and writes MRT state on the shared instance, so it works from any position in the tree.
89
+
90
+ ### Fully custom markup with MRT_TableBodyCellValue
91
+
92
+ ```tsx
93
+ import { MRT_TableBodyCellValue, flexRender } from '@lminii/material-react-table'
94
+
95
+ <Table>
96
+ <TableHead>
97
+ {table.getHeaderGroups().map((group) => (
98
+ <TableRow key={group.id}>
99
+ {group.headers.map((header) => (
100
+ <TableCell key={header.id}>
101
+ {header.isPlaceholder ? null : flexRender(header.column.columnDef.Header ?? header.column.columnDef.header, header.getContext())}
102
+ </TableCell>
103
+ ))}
104
+ </TableRow>
105
+ ))}
106
+ </TableHead>
107
+ <TableBody>
108
+ {table.getRowModel().rows.map((row, staticRowIndex) => (
109
+ <TableRow key={row.id} selected={row.getIsSelected()}>
110
+ {row.getVisibleCells().map((cell) => (
111
+ <TableCell key={cell.id}>
112
+ <MRT_TableBodyCellValue cell={cell} table={table} staticRowIndex={staticRowIndex} />
113
+ </TableCell>
114
+ ))}
115
+ </TableRow>
116
+ ))}
117
+ </TableBody>
118
+ </Table>
119
+ ```
120
+
121
+ `MRT_TableBodyCellValue` applies the column's `Cell`, `AggregatedCell`, `GroupedCell`, filter match highlighting, and click to copy, so custom markup keeps MRT cell behaviour. `table.getRowModel()` is the final model after filtering, sorting, grouping, expanding, and pagination.
122
+
123
+ ### Row virtualization in custom layouts
124
+
125
+ Render `MRT_TableContainer` rather than `MRT_Table` when `enableRowVirtualization` or `enableColumnVirtualization` is on. The container owns the scroll element the virtualizers measure.
126
+
127
+ ## Common Mistakes
128
+
129
+ ### HIGH Rendering MRT components without the table prop
130
+
131
+ Wrong:
132
+
133
+ ```tsx
134
+ <MRT_TablePagination />
135
+ ```
136
+
137
+ Correct:
138
+
139
+ ```tsx
140
+ <MRT_TablePagination table={table} />
141
+ ```
142
+
143
+ MRT does not use React context. Every component requires the instance explicitly.
144
+
145
+ Source: `packages/material-react-table/src/components/toolbar/MRT_TablePagination.tsx`
146
+
147
+ ### MEDIUM Duplicating the toolbar
148
+
149
+ Wrong:
150
+
151
+ ```tsx
152
+ const table = useMaterialReactTable({ columns, data })
153
+ <MRT_GlobalFilterTextField table={table} />
154
+ <MaterialReactTable table={table} />
155
+ ```
156
+
157
+ Correct:
158
+
159
+ ```tsx
160
+ const table = useMaterialReactTable({ columns, data, enableTopToolbar: false })
161
+ <MRT_GlobalFilterTextField table={table} />
162
+ <MaterialReactTable table={table} />
163
+ ```
164
+
165
+ The default top toolbar already contains the search field, so two inputs fight over `globalFilter`.
166
+
167
+ Source: `docs/api/mrt-components.mdx`
168
+
169
+ ### MEDIUM Using a v8 header render
170
+
171
+ Wrong:
172
+
173
+ ```tsx
174
+ flexRender(header.column.columnDef.header, header.getContext())
175
+ ```
176
+
177
+ Correct:
178
+
179
+ ```tsx
180
+ flexRender(header.column.columnDef.Header ?? header.column.columnDef.header, header.getContext())
181
+ ```
182
+
183
+ MRT columns carry both `header` (string) and `Header` (custom render). Falling back to the string alone drops custom header markup.
184
+
185
+ Source: `apps/material-react-table-docs/examples/custom-headless/sandbox/src/TS.tsx`
186
+
187
+ ## API Discovery
188
+
189
+ `node_modules/@lminii/material-react-table/dist/index.d.ts` exports every `MRT_*` component with its props interface; all of them include `table: MRT_TableInstance<TData>`. The component tree with links to source is at `/docs/api/mrt-components`.
@@ -0,0 +1,190 @@
1
+ ---
2
+ name: customization
3
+ description: >
4
+ Style and extend Material React Table V4 through mui*Props objects and callbacks, the sx prop, Material UI V9 slotProps on text fields, render* slots for toolbars, row actions, detail panels and empty states, displayColumnDefOptions, icons, and localization. Load for theming, conditional row or cell styling, custom toolbar buttons, or replacing built-in display columns.
5
+ metadata:
6
+ type: framework
7
+ library: '@lminii/material-react-table'
8
+ library_version: '4.0.0'
9
+ framework: react
10
+ requires:
11
+ - getting-started
12
+ sources:
13
+ - 'lminii/material-react-table:apps/material-react-table-docs/pages/docs/guides/customize-components.mdx'
14
+ - 'lminii/material-react-table:apps/material-react-table-docs/pages/docs/guides/display-columns.mdx'
15
+ - 'lminii/material-react-table:apps/material-react-table-docs/pages/docs/guides/toolbar-customization.mdx'
16
+ - 'lminii/material-react-table:apps/material-react-table-docs/pages/docs/guides/row-actions.mdx'
17
+ - 'lminii/material-react-table:MIGRATION.md'
18
+ ---
19
+
20
+ This skill builds on `getting-started`. MRT renders Material UI components and forwards props to each of them through a matching `mui<Component>Props` option, so customization means passing Material UI props, not overriding MRT internals.
21
+
22
+ ## Setup
23
+
24
+ ```tsx
25
+ const table = useMaterialReactTable({
26
+ columns,
27
+ data,
28
+ muiTablePaperProps: { elevation: 0, sx: { borderRadius: 0 } },
29
+ muiTableBodyRowProps: ({ row }) => ({
30
+ sx: { backgroundColor: row.getIsSelected() ? 'action.selected' : undefined },
31
+ }),
32
+ muiTableBodyCellProps: ({ column }) => ({
33
+ align: column.id === 'amount' ? 'right' : 'left',
34
+ }),
35
+ })
36
+ ```
37
+
38
+ Every `mui*Props` option accepts a static object or a callback. The callback receives `table` plus whatever is in scope for that component: `row`, `cell`, `column`, `staticRowIndex`, `isDetailPanel`, and similar. Static objects are cheaper; use a callback only when the props depend on data.
39
+
40
+ ## Core Patterns
41
+
42
+ ### Text field options use Material UI V9 slotProps
43
+
44
+ ```tsx
45
+ muiSearchTextFieldProps: {
46
+ placeholder: 'Search people',
47
+ slotProps: {
48
+ input: { startAdornment: <SearchIcon /> },
49
+ htmlInput: { 'aria-label': 'Search people' },
50
+ inputLabel: { shrink: true },
51
+ },
52
+ },
53
+ ```
54
+
55
+ `muiEditTextFieldProps`, `muiFilterTextFieldProps`, and `muiSearchTextFieldProps` take `slotProps.input`, `slotProps.htmlInput`, `slotProps.select`, and `slotProps.inputLabel`. MRT merges the object form of each slot after its own defaults and composes `sx`. The function form `(ownerState) => props` is ignored.
56
+
57
+ ### Column-level props override table-level props
58
+
59
+ ```tsx
60
+ const columns: MRT_ColumnDef<Person>[] = [
61
+ {
62
+ accessorKey: 'salary',
63
+ header: 'Salary',
64
+ muiTableHeadCellProps: { align: 'right' },
65
+ muiTableBodyCellProps: { align: 'right' },
66
+ Cell: ({ cell }) => cell.getValue<number>().toLocaleString('en-US', { style: 'currency', currency: 'USD' }),
67
+ },
68
+ ]
69
+ ```
70
+
71
+ `muiTableHeadCellProps`, `muiTableBodyCellProps`, `muiTableFooterCellProps`, `muiFilter*Props`, `muiEditTextFieldProps`, `muiCopyButtonProps`, and `muiColumnActionsButtonProps` exist on both the table options and the column definition. The column value wins.
72
+
73
+ ### render* slots add UI without replacing MRT components
74
+
75
+ ```tsx
76
+ const table = useMaterialReactTable({
77
+ columns,
78
+ data,
79
+ enableRowActions: true,
80
+ positionActionsColumn: 'last',
81
+ renderRowActionMenuItems: ({ row, closeMenu }) => [
82
+ <MenuItem key="edit" onClick={() => { edit(row.original); closeMenu() }}>Edit</MenuItem>,
83
+ ],
84
+ renderTopToolbarCustomActions: ({ table }) => (
85
+ <Button onClick={() => exportRows(table.getPrePaginatedRowModel().rows)}>Export</Button>
86
+ ),
87
+ renderDetailPanel: ({ row }) => <Address address={row.original.address} />,
88
+ renderEmptyRowsFallback: () => <Typography>No people match these filters</Typography>,
89
+ })
90
+ ```
91
+
92
+ `renderTopToolbar` and `renderBottomToolbar` replace the whole toolbar; `renderTopToolbarCustomActions`, `renderBottomToolbarCustomActions`, and `renderToolbarInternalActions` add to it. `renderRowActions` renders inline buttons; `renderRowActionMenuItems` fills the kebab menu. `renderDetailPanel` also makes every row expandable.
93
+
94
+ ### Adjust built-in display columns
95
+
96
+ ```tsx
97
+ displayColumnDefOptions: {
98
+ 'mrt-row-actions': { header: '', size: 80, muiTableHeadCellProps: { align: 'center' } },
99
+ 'mrt-row-select': { enableColumnActions: false },
100
+ 'mrt-row-expand': { size: 40 },
101
+ },
102
+ ```
103
+
104
+ Display column ids are `mrt-row-actions`, `mrt-row-drag`, `mrt-row-expand`, `mrt-row-numbers`, `mrt-row-pin`, `mrt-row-select`, and `mrt-row-spacer`. They exist only when the matching feature is enabled.
105
+
106
+ ### Icons and localization
107
+
108
+ ```tsx
109
+ import { MRT_Localization_DE } from '@lminii/material-react-table/locales/de'
110
+
111
+ const table = useMaterialReactTable({
112
+ columns,
113
+ data,
114
+ localization: MRT_Localization_DE,
115
+ icons: { SearchIcon: (props) => <TravelExploreIcon {...props} /> },
116
+ })
117
+ ```
118
+
119
+ `icons` accepts a partial `MRT_Icons` map; `localization` accepts a partial `MRT_Localization`, so overriding a few strings is fine.
120
+
121
+ ## Common Mistakes
122
+
123
+ ### HIGH Passing removed Material UI text field props
124
+
125
+ Wrong:
126
+
127
+ ```tsx
128
+ muiSearchTextFieldProps: {
129
+ InputProps: { startAdornment: <SearchIcon /> },
130
+ inputProps: { 'aria-label': 'Search' },
131
+ }
132
+ ```
133
+
134
+ Correct:
135
+
136
+ ```tsx
137
+ muiSearchTextFieldProps: {
138
+ slotProps: {
139
+ input: { startAdornment: <SearchIcon /> },
140
+ htmlInput: { 'aria-label': 'Search' },
141
+ },
142
+ }
143
+ ```
144
+
145
+ Material UI V9 removed `InputProps`, `inputProps`, `SelectProps`, `InputLabelProps`, and `FormHelperTextProps` from `TextField`, so the old keys are type errors and are never applied.
146
+
147
+ Source: `MIGRATION.md`
148
+
149
+ ### MEDIUM Styling with a class selector instead of the sx prop
150
+
151
+ Wrong:
152
+
153
+ ```tsx
154
+ muiTableBodyCellProps: { className: 'my-cell' }
155
+ // plus a global .my-cell rule fighting Material UI specificity
156
+ ```
157
+
158
+ Correct:
159
+
160
+ ```tsx
161
+ muiTableBodyCellProps: {
162
+ sx: (theme) => ({ borderRight: `1px solid ${theme.palette.divider}` }),
163
+ }
164
+ ```
165
+
166
+ `sx` receives the Material UI theme and wins the specificity contest with Emotion styles that MRT already applies.
167
+
168
+ Source: `docs/guides/customize-components.mdx`
169
+
170
+ ### MEDIUM Replacing the toolbar when only a button was needed
171
+
172
+ Wrong:
173
+
174
+ ```tsx
175
+ renderTopToolbar: ({ table }) => <Button onClick={add}>Add</Button>
176
+ ```
177
+
178
+ Correct:
179
+
180
+ ```tsx
181
+ renderTopToolbarCustomActions: ({ table }) => <Button onClick={add}>Add</Button>
182
+ ```
183
+
184
+ `renderTopToolbar` removes the search box, filter toggle, density and full screen buttons, and the alert banner. The `*CustomActions` slot keeps them.
185
+
186
+ Source: `docs/guides/toolbar-customization.mdx`
187
+
188
+ ## API Discovery
189
+
190
+ Search `node_modules/@lminii/material-react-table/dist/index.d.ts` for `mui` to see every prop option and its callback arguments, and for `render` to see every render slot. The Customize Components guide at `/docs/guides/customize-components` lists the options per component, and `/docs/api/column-options` marks which options also exist on columns.
@@ -0,0 +1,227 @@
1
+ ---
2
+ name: drag-and-drop-ordering
3
+ description: >
4
+ Reorder columns and rows by drag and drop in Material React Table V4: enableColumnOrdering with the columnOrder state and mrt-row-* display column ids, enableRowOrdering with muiRowDragHandleProps onDragEnd reading draggingRow and hoveredRow, enableRowDragging for dropping rows onto other tables or UI, enableColumnDragging for column drags without reordering, and the draggingColumn, hoveredColumn, draggingRow, hoveredRow state. Load for user-arranged columns, sortable lists, moving rows between tables, or a drop that never fires.
5
+ metadata:
6
+ type: framework
7
+ library: '@lminii/material-react-table'
8
+ library_version: '4.0.0'
9
+ framework: react
10
+ requires:
11
+ - getting-started
12
+ - state-and-server-data
13
+ - '@tanstack/table-core#column-ordering'
14
+ sources:
15
+ - 'lminii/material-react-table:apps/material-react-table-docs/pages/docs/guides/column-ordering-dnd.mdx'
16
+ - 'lminii/material-react-table:apps/material-react-table-docs/pages/docs/guides/row-ordering-dnd.mdx'
17
+ - 'lminii/material-react-table:apps/material-react-table-docs/examples/enable-row-ordering/sandbox/src/TS.tsx'
18
+ - 'lminii/material-react-table:apps/material-react-table-docs/examples/enable-row-dragging/sandbox/src/TS.tsx'
19
+ - 'lminii/material-react-table:packages/material-react-table/src/components/body/MRT_TableBodyRowGrabHandle.tsx'
20
+ - 'lminii/material-react-table:packages/material-react-table/src/utils/column.utils.ts'
21
+ ---
22
+
23
+ This skill builds on `getting-started`, `state-and-server-data`, and `@tanstack/table-core#column-ordering`. MRT uses native HTML drag events with a grab handle button. Column ordering is fully built in; row ordering exposes the drag state and leaves the reorder of `data` to you.
24
+
25
+ ## Setup
26
+
27
+ ```tsx
28
+ const table = useMaterialReactTable({
29
+ columns,
30
+ data,
31
+ enableColumnOrdering: true, // drag handles in every header
32
+ enableRowOrdering: true, // adds the mrt-row-drag display column
33
+ enableSorting: false, // manual order and sorting fight each other
34
+ muiRowDragHandleProps: ({ table }) => ({
35
+ onDragEnd: () => {
36
+ const { draggingRow, hoveredRow } = table.getState()
37
+ if (draggingRow && hoveredRow) {
38
+ setData((old) => {
39
+ const next = [...old]
40
+ next.splice(hoveredRow.index!, 0, next.splice(draggingRow.index, 1)[0])
41
+ return next
42
+ })
43
+ }
44
+ },
45
+ }),
46
+ })
47
+ ```
48
+
49
+ Column-level `enableColumnOrdering: false` removes the handle from one column. `hoveredRow` and `hoveredColumn` are typed as partial objects because a drop target may be a placeholder; read `index` or `id` and guard for undefined.
50
+
51
+ ## Core Patterns
52
+
53
+ ### Set or persist the column order
54
+
55
+ ```tsx
56
+ const [columnOrder, setColumnOrder] = useState<MRT_ColumnOrderState>([
57
+ 'mrt-row-select',
58
+ 'name',
59
+ 'email',
60
+ 'mrt-row-actions',
61
+ ])
62
+
63
+ const table = useMaterialReactTable({
64
+ columns,
65
+ data,
66
+ enableRowSelection: true,
67
+ enableRowActions: true,
68
+ enableColumnOrdering: true,
69
+ state: { columnOrder },
70
+ onColumnOrderChange: setColumnOrder,
71
+ })
72
+ ```
73
+
74
+ `columnOrder` is an array of column ids (`accessorKey` or `id`). Include the display column ids you enable (`mrt-row-select`, `mrt-row-actions`, `mrt-row-expand`, `mrt-row-numbers`, `mrt-row-drag`, `mrt-row-pin`) at the position you want; missing ones are appended at the start or end. If the array length does not match the column count MRT regenerates it, so `initialState.columnOrder` is enough when you only need a default. A dropped column is also pinned to the target column's pin position.
75
+
76
+ ### Move rows between tables
77
+
78
+ ```tsx
79
+ const [draggingRow, setDraggingRow] = useState<MRT_Row<Person> | null>(null)
80
+ const [hoveredTable, setHoveredTable] = useState<string | null>(null)
81
+
82
+ const common = {
83
+ columns,
84
+ enableRowDragging: true, // handle only; no in-table reorder
85
+ onDraggingRowChange: setDraggingRow,
86
+ state: { draggingRow },
87
+ }
88
+
89
+ const table1 = useMaterialReactTable({
90
+ ...common,
91
+ data: data1,
92
+ getRowId: (row) => `t1-${row.id}`,
93
+ muiRowDragHandleProps: {
94
+ onDragEnd: () => {
95
+ if (hoveredTable === 'table-2' && draggingRow) {
96
+ setData2((rows) => [...rows, draggingRow.original])
97
+ setData1((rows) => rows.filter((r) => r !== draggingRow.original))
98
+ }
99
+ setHoveredTable(null)
100
+ },
101
+ },
102
+ muiTablePaperProps: {
103
+ onDragEnter: () => setHoveredTable('table-1'),
104
+ sx: { outline: hoveredTable === 'table-1' ? '2px dashed' : undefined },
105
+ },
106
+ })
107
+ ```
108
+
109
+ `enableRowDragging` shows the handle and maintains `draggingRow` without the in-table hover targets that `enableRowOrdering` adds. Any element can be a drop target through its own `onDragEnter`. Share `draggingRow` across tables by controlling it. Use `enableColumnDragging` the same way for columns that should be draggable onto external targets, for example a group-by drop zone.
110
+
111
+ ### Style the drag interaction
112
+
113
+ ```tsx
114
+ muiRowDragHandleProps: ({ row }) => ({
115
+ 'aria-label': `Move ${row.original.name}`,
116
+ sx: { cursor: 'grab' },
117
+ }),
118
+ muiTableBodyRowProps: ({ row, table }) => ({
119
+ sx: {
120
+ opacity: table.getState().draggingRow?.id === row.id ? 0.5 : 1,
121
+ outline: table.getState().hoveredRow?.id === row.id ? '2px dashed' : undefined,
122
+ },
123
+ }),
124
+ ```
125
+
126
+ `muiRowDragHandleProps` takes `IconButtonProps`; your `onDragStart` and `onDragEnd` run before MRT sets or clears `draggingRow`. `muiColumnDragHandleProps` is the column counterpart, and `hoveredColumn` / `draggingColumn` drive header styling. Replace the handle icon through `icons.DragHandleIcon`.
127
+
128
+ ### Combine with virtualization
129
+
130
+ ```tsx
131
+ enableRowOrdering: true,
132
+ enableRowVirtualization: true,
133
+ enablePagination: false,
134
+ ```
135
+
136
+ The row virtualizer keeps the dragging row mounted while it is scrolled out of view, so drops still resolve. Keep `autoResetPageIndex: false` when paginated so a drop does not jump back to page one.
137
+
138
+ ## Common Mistakes
139
+
140
+ ### HIGH Reordering with the wrong row index
141
+
142
+ Wrong:
143
+
144
+ ```tsx
145
+ onDragEnd: () => {
146
+ const { draggingRow, hoveredRow } = table.getState()
147
+ data.splice(hoveredRow.index, 0, data.splice(draggingRow.index, 1)[0])
148
+ setData(data) // same array reference, no re-render
149
+ },
150
+ ```
151
+
152
+ Correct:
153
+
154
+ ```tsx
155
+ onDragEnd: () => {
156
+ const { draggingRow, hoveredRow } = table.getState()
157
+ if (!draggingRow || hoveredRow?.index === undefined) return
158
+ setData((old) => {
159
+ const next = [...old]
160
+ next.splice(hoveredRow.index!, 0, next.splice(draggingRow.index, 1)[0])
161
+ return next
162
+ })
163
+ },
164
+ ```
165
+
166
+ `row.index` is the index in the original `data` array, so it is only meaningful when no client-side sort or filter is applied; and a mutated array with the same reference does not trigger a render.
167
+
168
+ Source: `docs/examples/enable-row-ordering`
169
+
170
+ ### HIGH Expecting a drop callback
171
+
172
+ Wrong:
173
+
174
+ ```tsx
175
+ onHoveredRowChange: (row) => moveRow(row), // fires on every hover, not on drop
176
+ ```
177
+
178
+ Correct:
179
+
180
+ ```tsx
181
+ muiRowDragHandleProps: { onDragEnd: () => moveRow(table.getState().hoveredRow) },
182
+ ```
183
+
184
+ There is no `onRowDrop`; the drop point is the handle's `onDragEnd`, after which MRT clears `draggingRow` and `hoveredRow`.
185
+
186
+ Source: `packages/material-react-table/src/components/body/MRT_TableBodyRowGrabHandle.tsx`
187
+
188
+ ### MEDIUM Leaving sorting on with row ordering
189
+
190
+ Wrong:
191
+
192
+ ```tsx
193
+ enableRowOrdering: true,
194
+ ```
195
+
196
+ Correct:
197
+
198
+ ```tsx
199
+ enableRowOrdering: true,
200
+ enableSorting: false,
201
+ ```
202
+
203
+ A sorted view re-sorts after every drop, so the user's arrangement disappears and `row.index` no longer maps to the visible position.
204
+
205
+ Source: `docs/guides/row-ordering-dnd.mdx`
206
+
207
+ ### MEDIUM Column order array that ignores display columns
208
+
209
+ Wrong:
210
+
211
+ ```tsx
212
+ initialState: { columnOrder: ['name', 'email'] }, // with enableRowSelection: true
213
+ ```
214
+
215
+ Correct:
216
+
217
+ ```tsx
218
+ initialState: { columnOrder: ['mrt-row-select', 'name', 'email'] },
219
+ ```
220
+
221
+ The length mismatch makes MRT regenerate the order from the column definitions, discarding the custom arrangement.
222
+
223
+ Source: `docs/guides/column-ordering-dnd.mdx`
224
+
225
+ ## API Discovery
226
+
227
+ Search `node_modules/@lminii/material-react-table/dist/index.d.ts` for `enableRowOrdering`, `enableRowDragging`, `muiRowDragHandleProps`, `muiColumnDragHandleProps`, `draggingRow`, and `hoveredColumn`. The Column Ordering and Row Ordering guides at `/docs/guides/column-ordering-dnd` and `/docs/guides/row-ordering-dnd` list the related options, and `/docs/examples/enable-column-ordering`, `enable-row-ordering`, and `enable-row-dragging` are runnable examples.