react-jsonschema-form icon indicating copy to clipboard operation
react-jsonschema-form copied to clipboard

I would like to make a default change to the look of all input fields

Open dowling-john opened this issue 2 years ago • 5 comments

Prerequisites

What theme are you using?

core

What is your question?

I would like to set the border on all input types to underline, I can see a way to modify the border option.

Any help would be appriciated

dowling-john avatar Mar 20 '24 12:03 dowling-john

@dowling-john Can you provide more information, such as which theme are you using?

heath-freenome avatar Mar 22 '24 19:03 heath-freenome

Ok so here is my theme definition

`export const Theme = createTheme({ palette: { primary: { main: '#077D8DFF', }, secondary: { main: '#077D8DFF', }, }, typography: { fontFamily: [ 'Quicksand' ].join(','), }, spacing: 6, });

`

I am using https://mui.com/core/ to render the components, I am sure that this is because the elements gerated are not the same as the ones in mui core, so what I would like to do is manipulate the borders on all input elements, and would like to klnow how to define borders in the theme

thanks

dowling-john avatar Mar 23 '24 08:03 dowling-john

@dowling-john Well, first of all the @rjsf/mui theme is using @mui/material out of the box with no other modifications. It seems like if you followed the theming guide you should be able to affect the look and feel of the components.

heath-freenome avatar Mar 25 '24 18:03 heath-freenome

After looking at this for a while it would seem that this is the issue

https://github.com/rjsf-team/react-jsonschema-form/issues/1987

It would seem that by default an OutlinedInput component is used rather then just a normal Input component, is there a way that I can defind it to use the Iput componet rather then the Outlined one ?

dowling-john avatar Mar 29 '24 08:03 dowling-john

@dowling-john The Mui theme, out of the box uses the outlined variant because that is the default that @mui/material uses. You should be able to use the theming guide to provide a different theme for material-ui... You can also override the BaseInputTemplate to change the variant per the second example here. Again, there is nothing specific to RJSF that is blocking you from changing the look and feel of material-ui via their usual mechanisms.

heath-freenome avatar Apr 01 '24 17:04 heath-freenome