` will be rendered as an ``or ` | ` depending
* on the context it is used in. Where context literally is the
@@ -46,7 +49,7 @@ export interface TableCellProps extends StandardProps;
/**
* Set aria-sort direction.
*/
diff --git a/packages/mui-material/src/TableCell/TableCell.js b/packages/mui-material/src/TableCell/TableCell.js
index 0987a29d8852ef..f937b0798e386d 100644
--- a/packages/mui-material/src/TableCell/TableCell.js
+++ b/packages/mui-material/src/TableCell/TableCell.js
@@ -220,7 +220,10 @@ TableCell.propTypes /* remove-proptypes */ = {
* Specify the size of the cell.
* The prop defaults to the value (`'medium'`) inherited from the parent Table component.
*/
- size: PropTypes.oneOf(['small', 'medium']),
+ size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
+ PropTypes.oneOf(['medium', 'small']),
+ PropTypes.string,
+ ]),
/**
* Set aria-sort direction.
*/
diff --git a/packages/mui-material/test/typescript/moduleAugmentation/tableCellCustomProps.spec.tsx b/packages/mui-material/test/typescript/moduleAugmentation/tableCellCustomProps.spec.tsx
new file mode 100644
index 00000000000000..87365b068c0301
--- /dev/null
+++ b/packages/mui-material/test/typescript/moduleAugmentation/tableCellCustomProps.spec.tsx
@@ -0,0 +1,35 @@
+import * as React from 'react';
+import Table from '@mui/material/Table';
+import TableCell from '@mui/material/TableCell';
+import { createTheme } from '@mui/material/styles';
+
+declare module '@mui/material/Table' {
+ interface TablePropsSizeOverrides {
+ large: true;
+ }
+}
+
+declare module '@mui/material/TableCell' {
+ interface TableCellPropsSizeOverrides {
+ large: true;
+ }
+}
+
+// theme typings should work as expected
+const theme = createTheme({
+ components: {
+ MuiTableCell: {
+ styleOverrides: {
+ root: ({ ownerState }) => ({
+ ...(ownerState.size === 'large' && {
+ paddingBlock: '1rem',
+ }),
+ }),
+ },
+ },
+ },
+});
+
+;
diff --git a/packages/mui-material/test/typescript/moduleAugmentation/tableCellCustomProps.tsconfig.json b/packages/mui-material/test/typescript/moduleAugmentation/tableCellCustomProps.tsconfig.json
new file mode 100644
index 00000000000000..31638de5fb0220
--- /dev/null
+++ b/packages/mui-material/test/typescript/moduleAugmentation/tableCellCustomProps.tsconfig.json
@@ -0,0 +1,4 @@
+{
+ "extends": "../../../../../tsconfig",
+ "files": ["tableCellCustomProps.spec.tsx"]
+}
|