Skip to content

Repository files navigation

Kin Form

JSR @kintools/form-core CI Coverage License: MIT Framework-agnostic Tiny footprint 100% type-safe Zero dependencies

Documentation · Get Started

Build your field components once. Reuse them everywhere.

A framework-agnostic form state library for TypeScript.

The payoff

<form onSubmit={form.handleSubmit}>
  <TextField api={form.field("email")} label="Email" />
  <AddressField api={form.field("shipping")} />
  <AddressField api={form.field("billing")} />
  <ItemsField api={form.field("items")} />
  <SubmitButton api={form}>Place order</SubmitButton>
</form>;

Each component receives a resolved FieldApi, not a path or form context. Define the UI and behavior once, then mount it anywhere its value type fits. Kin Form keeps that component independently subscribed, so a change only updates the part of the form that depends on it. See Form Composition for the full pattern.

Feature matrix

Kin Form React Hook Form Formik TanStack Form
Zero dependencies ⚠️
Framework-agnostic core
Type-safe nested field paths
Standard Schema support ⚠️ ⚠️
Nested groups/arrays as first-class nodes ⚠️ ⚠️
Selective re-rendering ⚠️
Built-in async-validation debounce
Declarative cross-field revalidation ⚠️

✅ full support · ⚠️ partial, conditional, or requires an extra package · ❌ not supported

Bundle size

Each package's full public API, bundled and minified the same way (rolldown) then gzipped. Reproduce with deno task --cwd scripts bundle-size. Not directly comparable to Bundlephobia, which uses a different minifier (terser).

@kintools/form-core                                   ██████░░░░░░░░░░░░░░░░░░    4.4 KB
@kintools/form-react (bindings only)                  █░░░░░░░░░░░░░░░░░░░░░░░    0.8 KB
@kintools/form-validators                             █░░░░░░░░░░░░░░░░░░░░░░░    0.7 KB

Kin Form (core + react)                          ███████░░░░░░░░░░░░░░░░░    5.0 KB
React Hook Form                                  █████████████████░░░░░░░   13.0 KB
Formik                                           ██████████████████░░░░░░   13.9 KB
Tanstack Form (core + react)                     ████████████████████████   18.5 KB

Performance

Flat field update, 800x burst, wall-clock median in Happy DOM: 1.39 ms for Kin Form vs 66.55 ms (React Hook Form), 3.30 ms (Formik), 564.24 ms (TanStack Form). One scenario from a shared ~84-field benchmark form driven through the same update plan against each library. Reproduce with deno task --cwd scripts speed-bench.

See the full comparison for the complete scenario breakdown (nested/array updates, validation, mount cost), methodology notes, and code-by-code comparisons.

Packages

Package Description
@kintools/form-core FieldApi, FormApi — the framework-agnostic form engine
@kintools/form-react useForm, useWatch, useMultistep, Watch — React bindings
@kintools/form-lit watch, WatchController, MultistepController — Lit bindings
@kintools/form-validators required, minLength, maxLength, min, max, url, email, pattern, maxFileSize, password, toSchemaValidator()
@kintools/form-devtools-react DevtoolsProvider, useFormDevtools — inspector panel for a form's live tree state during development

Releases

Packages

Contributors

Languages