@lesto/forms
v0.1.7
Published
Lesto's schema-driven forms — a form spec, a render to a @lesto/ui tree, and submission validation. Ships its own form components.
Readme
@lesto/forms
Schema-driven forms on @lesto/ui — one spec renders the form and validates the submission.
Part of Lesto, the batteries-included, agent-native fullstack framework.
bun add @lesto/formsimport { createFormRegistry, renderForm, validateSubmission, type FormSpec } from "@lesto/forms";
const spec: FormSpec = {
action: "/signup",
fields: [
{ name: "email", type: "email", required: true },
{ name: "age", type: "number" },
],
};
const tree = renderForm(spec); // a @lesto/ui node tree
const { valid, errors } = validateSubmission(spec, body); // built-in validator → per-field errorsShips its own form components — it uses @lesto/ui's engine and types (not
shadcn/zod), and the built-in validator returns per-field errors you render
inline on a 422.
