I want to add a class name for an individual input, but I could not find anything on the docs about a class name property for simpl-schema or uniforms-bridge-simple-schema-2.
import { AutoForm } from "uniforms-antd";
import SimpleSchemaBridge from "uniforms-bridge-simple-schema-2";
import SimpleSchema from "simpl-schema";
const rawSchema = {
name: {
type: String,
optional: true,
// className - how to add a class name for an individual input?
}
};
const schema = new SimpleSchemaBridge(new SimpleSchema(rawSchema));
return (
<AutoForm
schema={schema}
model={model ? model : {}}
onSubmit={(values: any) => {
onUpdate(values);
}}
/>
);
I have not explored all the APIs of
uniforms
. I found this way you can addclassNames
to each field.Their FAQ says :
App
css
Notes:
1) Check out all the fields of uniforms-antd.
2) Customizing your form layout