jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

[Question] Applying styles to JsonForms

Open zwjohn opened this issue 6 years ago • 2 comments

Hi, I'm new to this library and it's a very powerful library after going through some examples. I have a question which I couldn't find an answer in the documentation. How can I config style of controls or layout? I thought it should be part of uischema, but I failed to find any relevant configuration.

I tried to add style or className like other React components, but it doesn't work

        <JsonForms
            style={{"paddingTop": "20px"}}
            className="red-background"
            schema={schema}
            uischema={uischema}
            data={stateData}
            renderers={materialRenderers}
            cells={materialCells}
            onChange={handleChanges}
        />

Can someone shed some light on how to config or apply styles to the controls and the form?

Thanks!

John

zwjohn avatar Mar 20 '20 14:03 zwjohn

You can style the Material UI controls via their theme support. Besides theming and CSS styling the only way to influence the result would be to implement custom renderers which do exactly what you want.

In the vanilla renderers we set a bunch of classes which you can use for styling. You can even customize the classes which will be set.

sdirix avatar Mar 20 '20 16:03 sdirix

Closed as this is a question duplicated in Spectrum

sdirix avatar Mar 20 '20 16:03 sdirix