Architecture
MLForm is split into four public surfaces.
| Surface | Import | Responsibility |
|---|---|---|
| Kit | mlform or mlform/kit | Default mount path for applications. |
| Engine | mlform/engine | State, validation, registry, hooks, and submit flow. |
| Primitives | mlform/primitives | Built-in Web Components and primitive renderer registry. |
| Design system | mlform/design-system | Themes, recipes, token resolution, and host integration. |
Use the kit for application code. Drop to engine or primitives only when building custom renderers, registries, or integration layers.
import { createJsonTransport, mountForm } from "mlform";import type { FormSchema } from "mlform/engine";
const schema: FormSchema = { fields: [{ kind: "text", label: "Prompt" }],};
mountForm(container, { transport: createJsonTransport({ endpoint: "/predict" }), schema,});