form-schema-runtime - v1.0.0
    Preparing search index...

    Interface CreateFormOptions

    Options used to create and mount a form instance.

    interface CreateFormOptions {
        classPrefix?: string;
        container: HTMLElement;
        initialValues?: FormValues;
        onChange?: (values: FormValues, state: FormStateSnapshot) => void;
        onReset?: (state: FormStateSnapshot) => void;
        onSubmit?: (values: FormValues, state: FormStateSnapshot) => void;
        onValidationError?: (errors: FieldErrors, state: FormStateSnapshot) => void;
        renderers?: RendererMap;
        schema: FormSchema;
        validators?: CustomValidatorMap;
    }
    Index

    Properties

    classPrefix?: string

    CSS class prefix. Defaults to fsr.

    container: HTMLElement

    Container element whose children are owned by this form instance.

    initialValues?: FormValues

    Optional values merged over field defaults during initialization and reset.

    onChange?: (values: FormValues, state: FormStateSnapshot) => void

    Called after values change through UI input or setValues.

    onReset?: (state: FormStateSnapshot) => void

    Called after reset restores the initial state.

    onSubmit?: (values: FormValues, state: FormStateSnapshot) => void

    Called after a valid submit.

    onValidationError?: (errors: FieldErrors, state: FormStateSnapshot) => void

    Called when validation fails through submit or validate.

    renderers?: RendererMap

    Custom renderers keyed by field type.

    schema: FormSchema

    Declarative form schema to render.

    validators?: CustomValidatorMap

    Custom synchronous validators keyed by the names used in field schemas.