Getting Started
Install the framework-agnostic package and zod for its first-party Zod Mini schemas:
pnpm add @schema-engine/forms zodRegister the elements, recipes, and actions used by the application:
import { createFormEngine } from '@schema-engine/forms';
const engine = createFormEngine({
elements: [textInputRegistration],
recipes: [cardRecipe],
});Then define a form with engine.defineForm({ ... }). It returns a frozen
NormalizedFormConfig owned by that engine instance. See Authoring modes
for when to use defineForm versus portable JSON and validateForm.
const form = engine.defineForm({
id: 'contact',
steps: [{ id: 'details', title: 'Details', elements: [] }],
view: { $type: 'card' },
});For external or stored JSON, call engine.validateForm(unknown) — the same
pipeline as defineForm, without compile-time narrowing. Use
engine.getFormConfigStandardSchema() when another tool must validate configs
against Standard JSON Schema outside your app runtime.
Note: Framework adapters (React, Radiant) render a normalized form. They receive the same engine instance you used to validate or define the config.