Skip to content

MLForm

MLForm mounts validated, schema-driven forms that submit structured values to a machine learning backend and render model reports in the same host element.

Use it when a product needs a predictable input layer for models: prediction forms, scoring dashboards, review tools, forecasting panels, internal ML consoles, or any workflow where UI state and backend payloads must stay aligned.

import { createJsonTransport, mountForm } from "mlform";
mountForm(document.querySelector("#prediction-form") as HTMLElement, {
transport: createJsonTransport({ endpoint: "/api/predict" }),
schema: {
fields: [{ id: "prompt", kind: "text", label: "Prompt", required: true }],
reports: [{ id: "prediction", kind: "classifier", label: "Prediction" }],
},
});
KitMount forms with defaults for transport, primitives, labels, and design system.
EngineValidate fields, track state, run hooks, and submit through any transport.
PrimitivesRender built-in Web Components for fields, submit actions, and reports.
Design systemApply themes, recipes, density, motion, and host app token overrides.

Choose your path:

GoalStart here
I want a working formQuick Start
I need backend integrationFirst Backend
I need custom fields or reportsCustom Fields
I need themingDesign System Overview

If you are new to MLForm, read Mental Model before the reference pages.