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

option to select primary color for inputs

Open Morriz opened this issue 5 years ago • 5 comments

Prerequisites

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.

Morriz avatar Aug 02 '20 12:08 Morriz

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?

stanlemon avatar Aug 03 '20 21:08 stanlemon

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.

matthias-ccri avatar Aug 27 '20 19:08 matthias-ccri

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',
        },
    },
});

matthias-ccri avatar Aug 27 '20 20:08 matthias-ccri

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.

stale[bot] avatar Jul 22 '22 21:07 stale[bot]

it just makes no sense to give different colors to the inputs from a UX perspective imo

Morriz avatar Aug 01 '22 14:08 Morriz

@Morriz In 5.x checkboxes do not specify color anymore.

heath-freenome avatar Apr 09 '23 22:04 heath-freenome