Skip to main content

ScaffolderRJSFFormProps

Home > @backstage/plugin-scaffolder-react > ScaffolderRJSFFormProps

The properties that are passed to the Form

Signature:

export interface ScaffolderRJSFFormProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> 

Properties

PropertyModifiersTypeDescription
_internalFormWrapper?ElementType

(Optional) _internalFormWrapper is currently used by the semantic-ui theme to provide a custom wrapper around <Form /> that supports the proper rendering of those themes. To use this prop, one must pass a component that takes two props: children and as. That component, at minimum, should render the children inside of a

tag unless as is provided, in which case, use the as prop in place of <form />. i.e.:

export default function InternalForm({ children, as }) {
const FormTag = as || 'form';
return <FormTag>{children}</FormTag>;
}

Use at your own risk as this prop is private and may change at any time without notice.

| | [acceptcharset?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.acceptcharset) | | string | _(Optional)_ The value of this prop will be passed to the accept-charset HTML attribute on the form | | [action?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.action) | | string |

_(Optional)_ The value of this prop will be passed to the action HTML attribute on the form

NOTE: this just renders the action attribute in the HTML markup. There is no real network request being sent to this action on submit. Instead, react-jsonschema-form catches the submit event with event.preventDefault() and then calls the onSubmit function, where you could send a request programmatically with fetch or similar.

| | [autoComplete?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.autocomplete) | | string | _(Optional)_ The value of this prop will be passed to the autocomplete HTML attribute on the form | | [children?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.children) | | ReactNode | _(Optional)_ The optional children for the form, if provided, it will replace the default SubmitButton | | [className?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.classname) | | string | _(Optional)_ The value of this prop will be passed to the class HTML attribute on the form | | [customValidate?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.customvalidate) | | CustomValidator<T, S, F> | _(Optional)_ Formerly the validate prop; Takes a function that specifies custom validation rules for the form | | [disabled?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.disabled) | | boolean | _(Optional)_ It's possible to disable the whole form by setting the disabled prop. The disabled prop is then forwarded down to each field of the form. If you just want to disable some fields, see the ui:disabled parameter in uiSchema | | [enctype?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.enctype) | | string | _(Optional)_ The value of this prop will be passed to the enctype HTML attribute on the form | | [experimental\_defaultFormStateBehavior?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.experimental_defaultformstatebehavior) | | Experimental\_DefaultFormStateBehavior | _(Optional)_ Optional configuration object with flags, if provided, allows users to override default form state behavior Currently only affecting minItems on array fields and handling of setting defaults based on the value of emptyObjectFields | | [extraErrors?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.extraerrors) | | ErrorSchema<T> | _(Optional)_ This prop allows passing in custom errors that are augmented with the existing JSON Schema errors on the form; it can be used to implement asynchronous validation | | [fields?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.fields) | | [ScaffolderRJSFRegistryFieldsType](/docs/reference/plugin-scaffolder-react.scaffolderrjsfregistryfieldstype)<T, S, F> | _(Optional)_ The dictionary of registered fields in the form | | [focusOnFirstError?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.focusonfirsterror) | | boolean | ((error: RJSFValidationError) => void) | _(Optional)_ If set to true, then the first field with an error will receive the focus when the form is submitted with errors | | [formContext?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.formcontext) | | F |

_(Optional)_ You can provide a formContext object to the form, which is passed down to all fields and widgets. Useful for implementing context aware fields and widgets.

NOTE: Setting {readonlyAsDisabled: false} on the formContext will make the antd theme treat readOnly fields as disabled.

| | [formData?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.formdata) | | T | _(Optional)_ The data for the form, used to prefill a form with existing data | | [id?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.id) | | string | _(Optional)_ The value of this prop will be passed to the id HTML attribute on the form | | [idPrefix?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.idprefix) | | string | _(Optional)_ To avoid collisions with existing ids in the DOM, it is possible to change the prefix used for ids; Default is root | | [idSeparator?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.idseparator) | | string | _(Optional)_ To avoid using a path separator that is present in field names, it is possible to change the separator used for ids (Default is _) | | [liveOmit?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.liveomit) | | boolean | _(Optional)_ If omitExtraData and liveOmit are both set to true, then extra form data values that are not in any form field will be removed whenever onChange is called. Set to false by default | | [liveValidate?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.livevalidate) | | boolean | _(Optional)_ If set to true, the form will perform validation and show any validation errors whenever the form data is changed, rather than just on submit | | [method?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.method) | | string | _(Optional)_ The value of this prop will be passed to the method HTML attribute on the form | | [name?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.name) | | string | _(Optional)_ The value of this prop will be passed to the name HTML attribute on the form | | [noHtml5Validate?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.nohtml5validate) | | boolean | _(Optional)_ If set to true, turns off HTML5 validation on the form; Set to false by default | | [noValidate?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.novalidate) | | boolean | _(Optional)_ If set to true, turns off all validation. Set to false by default | | [omitExtraData?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.omitextradata) | | boolean | _(Optional)_ If set to true, then extra form data values that are not in any form field will be removed whenever onSubmit is called. Set to false by default. | | [onBlur?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.onblur) | | (id: string, data: any) => void | _(Optional)_ Sometimes you may want to trigger events or modify external state when a field has been touched, so you can pass an onBlur handler, which will receive the id of the input that was blurred and the field value | | [onChange?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.onchange) | | (data: IChangeEvent<T, S, F>, id?: string) => void | _(Optional)_ If you plan on being notified every time the form data are updated, you can pass an onChange handler, which will receive the same args as onSubmit any time a value is updated in the form. Can also return the id of the field that caused the change | | [onError?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.onerror) | | (errors: RJSFValidationError\[\]) => void | _(Optional)_ To react when submitted form data are invalid, pass an onError handler. It will be passed the list of encountered errors | | [onFocus?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.onfocus) | | (id: string, data: any) => void | _(Optional)_ Sometimes you may want to trigger events or modify external state when a field has been focused, so you can pass an onFocus handler, which will receive the id of the input that is focused and the field value | | [onSubmit?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.onsubmit) | | (data: IChangeEvent<T, S, F>, event: FormEvent<any>) => void | _(Optional)_ You can pass a function as the onSubmit prop of your Form component to listen to when the form is submitted and its data are valid. It will be passed a result object having a formData attribute, which is the valid form data you're usually after. The original event will also be passed as a second parameter | | [readonly?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.readonly) | | boolean | _(Optional)_ It's possible to make the whole form read-only by setting the readonly prop. The readonly prop is then forwarded down to each field of the form. If you just want to make some fields read-only, see the ui:readonly parameter in uiSchema | | [ref?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.ref) | | Ref<Form<T, S, F>> | _(Optional)_ Support receiving a React ref to the Form | | [schema](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.schema) | | S | The JSON schema object for the form | | [showErrorList?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.showerrorlist) | | false | 'top' | 'bottom' | _(Optional)_ When this prop is set to top or 'bottom', a list of errors (or the custom error list defined in the ErrorList) will also show. When set to false, only inline input validation errors will be shown. Set to top by default | | [tagName?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.tagname) | | ElementType | _(Optional)_ It's possible to change the default form tag name to a different HTML tag, which can be helpful if you are nesting forms. However, native browser form behaviour, such as submitting when the Enter key is pressed, may no longer work | | [target?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.target) | | string | _(Optional)_ The value of this prop will be passed to the target HTML attribute on the form | | [templates?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.templates) | | Partial<Omit<TemplatesType<T, S, F>, 'ButtonTemplates'>> & { ButtonTemplates?: Partial<TemplatesType<T, S, F>\['ButtonTemplates'\]>; } | _(Optional)_ The dictionary of registered templates in the form; Partial allows a subset to be provided beyond the defaults | | [transformErrors?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.transformerrors) | | ErrorTransformer<T, S, F> | _(Optional)_ A function can be passed to this prop in order to make modifications to the default errors resulting from JSON Schema validation | | [translateString?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.translatestring) | | Registry\['translateString'\] | _(Optional)_ Optional string translation function, if provided, allows users to change the translation of the RJSF internal strings. Some strings contain replaceable parameter values as indicated by %1, %2, etc. The number after the % indicates the order of the parameter. The ordering of parameters is important because some languages may choose to put the second parameter before the first in its translation. | | [uiSchema?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.uischema) | | UiSchema<T, S, F> | _(Optional)_ The uiSchema for the form | | [validator](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.validator) | | ValidatorType<T, S, F> | An implementation of the ValidatorType interface that is needed for form validation to work | | [widgets?](/docs/reference/plugin-scaffolder-react.scaffolderrjsfformprops.widgets) | | RegistryWidgetsType<T, S, F> | _(Optional)_ The dictionary of registered widgets in the form |