react-jsonschema-form
react-jsonschema-form copied to clipboard
option to select primary color for inputs
Prerequisites
- [x] I have read the documentation;
I think I read all of it, and am pretty sure I can't find it in any documentation, but please prove me wrong ;)
Description
The MUI theme inputs seem to be hardcoded to use color=secondaryColor. Can this be made configurable on the form? We use secondary for different elements.
This is on the <AddButton/> component used with arrays, correct? Semantically secondary seems to make sense here, since it's not the submit button. Are you proposing to make it primary, or to customize it? If the latter, how would you propose the customization be set?
To quote Material-UI - Palette:
primary - used to represent primary interface elements for a user. It's the color displayed most frequently across your app's screens and components. secondary - used to represent secondary interface elements for a user. It provides more ways to accent and distinguish your product. Having it is optional.
For my case, I would like to render checkboxes with the primary color. A checkboxe is never used as a submit button, and yet they support color="primary". Maybe it's a valid ui option to add.
A workaround — use a custom material-ui theme using ThemeProvider, and override the props for the Checkbox component, like this:
const theme = createMuiTheme({
props: {
MuiCheckbox: {
color: 'primary',
},
},
});
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.
it just makes no sense to give different colors to the inputs from a UX perspective imo
@Morriz In 5.x checkboxes do not specify color anymore.