API reference: @salmonui/inputs/form-renderer
FormRendererPropsinterface
import type { FormRendererProps } from '@salmonui/inputs/form-renderer';interface FormRendererProps extends Omit<FormProps, 'onSubmit' | 'children'> {
readonly schema: FormSchema;
readonly uiSchema?: FormUiSchema | undefined;
readonly onSubmit?: ((data: FormRendererData, details: FormRendererSubmitDetails, event: SubmitEvent<HTMLFormElement> | null) => void) | undefined;
readonly children?: ReactNode;
readonly size?: FieldSize | undefined;
readonly localeText?: FormRendererLocaleText | undefined;
}
| Name | Signature | Description |
|---|---|---|
schema | readonly schema: FormSchema; | JSON Schema subset. |
uiSchemaoptional | readonly uiSchema?: FormUiSchema | undefined; | Layout and widget choices. |
onSubmitoptional | readonly onSubmit?: ((data: FormRendererData, details: FormRendererSubmitDetails, event: SubmitEvent<HTMLFormElement> | null) => void) | undefined; | Every submit, valid or not, with the data typed by the schema. The native submit is prevented unless |
childrenoptional | readonly children?: ReactNode; | Rendered after the fields, before the submit button. |
sizeoptional | readonly size?: FieldSize | undefined; | Metric set of every field and the submit button. Default |
localeTextoptional | readonly localeText?: FormRendererLocaleText | undefined; | |
refoptionalinherited | ref?: Ref<HTMLFormElement>; | |
actionoptionalinherited | action?: string | ((formData: FormData) => void | Promise<void>); | A URL or a React 19 action ( |
validationBehavioroptionalinherited | validationBehavior?: ValidationBehavior; |
|
validateOnoptionalinherited | validateOn?: ValidateOn; | Default |
validationErrorsoptionalinherited | validationErrors?: Readonly<Record<string, string | readonly string[] | undefined>>; | Server errors keyed by field |
onBeforeValidateoptionalinherited | onBeforeValidate?: ((event: FormValidateEvent) => void); | |
onValidateoptionalinherited | onValidate?: ((result: FormValidationResult) => void); | |
requiredMarkoptionalinherited | requiredMark?: boolean; | Marks the label of every required field inside with a decorative
asterisk ( |