How to pass props to the underlying Material UI components used in the material renderers

Hi,

This seems to be a basic use case, so I expect I’m being a bit stupid, but I can’t find in the documentation how to pass a set of standard Material UI component props into all the rendered elements of my form. For example, variant=“filled”, fullWidth. Is this possible?

Hi @econtentmaps, these use cases are usually served via the Material UI theme support, including such props.

Is there a use case you can’t accomplish this way?

Hello Stefan,

I’m attempting to use material theme support to change the form input variant but the inputs seem to be ignoring the theme props

const theme = createMuiTheme({
  props: {
    MuiFormControl: {
      variant: 'outlined',
    },
    MuiTextField: {
      variant: 'outlined',
    },
  },
});

Date inputs change according to custom props, but text inputs ignore them.

I am able to reproduce the issue in 2.5.2 and 3.0.0-alpha.1.

Any insight would be appreciated.

Hi @cg-dev,

the problem here is that we don’t use MuiTextField in our renderers but just a regular Input. Therefore the props can’t apply.

If you’d like to use MuiTextField instead you’ll need to implement a custom renderer.