- control
- array.layout → id for the whole control
- array.button → id for the add button
- array.children → id for the area of the children
- categorization → id for the whole control
- categorization.master → id for the master part
- categorization.detail → id for the detail part
- category.subcategories → id for a new list in the master
- category.group → id for a categorization in the master list
- label-control → id for the label
- array.table → id for the whole control
- array.table.table → id for the table
- array.table.label → id for the label in the header
- array.table.button → id for the add button
- array.table.validation → id for the validation field
- array.table.validation.error → id for the validation error field
- array.validation.error → id for the validation column if activated
- group-layout-item → class for a child
- group.layout → id for the group
- group.label → id for the group label
- group.layout.item → id for each wrapper of the children of the group
- horizontal-layout-item → class for a child
- horizontal.layout → id for the horizontal layout
- horizontal.layout.item → id for each wrapper of the children of the horizontal layout
- vertical-layout-item → class for a child
- vertical.layout → id for the vertical layout
- vertical.layout.item → id for each wrapper of the children of the vertical layout
- validate valid/invalid → id for the input of control indicating whether it is valid or not
- control → id for the whole control
- control.label → id for the label of control
- control.validation → id for the validation of control
- control.validation.error → id for the validation error of control
- input.description → id for the description of control
By default, the vanillaStyles
defined in src/styles/styles.ts are applied.
These can be overwritten via the JsonFormsStyleContext
.
The following example will completely replace the default styles.
import { JsonFormsStyleContext } from '@jsonforms/vanilla-renderers';
const styleContextValue = { styles: [
{
name: 'control.input',
classNames: ['custom-input']
},
{
name: 'array.button',
classNames: ['custom-array-button']
}
]};
<JsonFormsStyleContext.Provider value={styleContextValue}>
<JsonForms
data={data}
schema={schema}
uischema={uischema}
...
/>
</JsonFormsStyleContext.Provider>
You can also extend the existing default styles. Thereby, the existing style classes as well as your custom ones will be applied. This is the case because all style definitions for an ID are merged.
import { JsonFormsStyleContext, vanillaStyles } from '@jsonforms/vanilla-renderers';
const styleContextValue = { styles: [
...vanillaStyles,
{
name: 'control.input',
classNames: ['custom-input']
},
{
name: 'array.button',
classNames: ['custom-array-button']
}
]};
<JsonFormsStyleContext.Provider value={styleContextValue}>
<JsonForms
data={data}
schema={schema}
uischema={uischema}
...
/>
</JsonFormsStyleContext.Provider>