{
* @default 1
*/
step?: number | null;
+ /**
+ * System props to apply to the component.
+ */
+ system?: ElementProps & SystemProps;
/**
* The track presentation:
*
diff --git a/packages/material-ui-lab/src/SliderUnstyled/SliderUnstyled.js b/packages/material-ui-lab/src/SliderUnstyled/SliderUnstyled.js
index 1fb2b896363eb1..75f06bfc9344e6 100644
--- a/packages/material-ui-lab/src/SliderUnstyled/SliderUnstyled.js
+++ b/packages/material-ui-lab/src/SliderUnstyled/SliderUnstyled.js
@@ -905,6 +905,10 @@ SliderUnstyled.propTypes = {
* @default 1
*/
step: PropTypes.number,
+ /**
+ * System props to apply to the component.
+ */
+ system: PropTypes.object,
/**
* The track presentation:
*
diff --git a/packages/material-ui-system/src/breakpoints.js b/packages/material-ui-system/src/breakpoints.js
index 029896503ce07b..a97d6916764e77 100644
--- a/packages/material-ui-system/src/breakpoints.js
+++ b/packages/material-ui-system/src/breakpoints.js
@@ -47,9 +47,10 @@ export function handleBreakpoints(props, propValue, styleFromPropValue) {
}
function breakpoints(styleFunction) {
- const newStyleFunction = (props) => {
- const base = styleFunction(props);
- const themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
+ const newStyleFunction = (componentProps) => {
+ const base = styleFunction(componentProps);
+ const themeBreakpoints = componentProps.theme.breakpoints || defaultBreakpoints;
+ const props = componentProps.system || componentProps;
const extended = themeBreakpoints.keys.reduce((acc, key) => {
if (props[key]) {
diff --git a/packages/material-ui-system/src/spacing.js b/packages/material-ui-system/src/spacing.js
index 41d191eb8928f1..72f74f17b95e10 100644
--- a/packages/material-ui-system/src/spacing.js
+++ b/packages/material-ui-system/src/spacing.js
@@ -149,9 +149,10 @@ function getStyleFromPropValue(cssProperties, transformer) {
}, {});
}
-function spacing(props) {
- const theme = props.theme;
+function spacing(componentProps) {
+ const theme = componentProps.theme;
const transformer = createUnarySpacing(theme);
+ const props = componentProps.system || componentProps;
return Object.keys(props)
.map((prop) => {
diff --git a/packages/material-ui-system/src/style.js b/packages/material-ui-system/src/style.js
index d499579507ff1f..b2dc48adf4c0b0 100644
--- a/packages/material-ui-system/src/style.js
+++ b/packages/material-ui-system/src/style.js
@@ -13,11 +13,12 @@ function style(options) {
const { prop, cssProperty = options.prop, themeKey, transform } = options;
const fn = (props) => {
- if (props[prop] == null) {
+ const propValue = props[prop] || props.system?.[prop];
+
+ if (propValue == null) {
return null;
}
- const propValue = props[prop];
const theme = props.theme;
const themeMapping = getPath(theme, themeKey) || {};
const styleFromPropValue = (propValueFinal) => {
diff --git a/packages/material-ui/src/Box/Box.d.ts b/packages/material-ui/src/Box/Box.d.ts
index 2eb664df6c9d61..09a1529a196d40 100644
--- a/packages/material-ui/src/Box/Box.d.ts
+++ b/packages/material-ui/src/Box/Box.d.ts
@@ -30,8 +30,8 @@ type BoxStyleFunction = ComposedStyleFunction<
]
>;
-type SystemProps = PropsFor