Features
Performant, type-safe React forms that work the same on the web, with native and Next.js Server Actions, and in React Native - no adapters, no casts, zero dependencies.
Lightweight & fast
Zero dependencies — Nothing to install but React itself -
reactandreact-domare the only peers.Tree-shakable — Import only what you use to keep bundles small.
Minimal re-renders — Only the fields that actually change re-render - never the whole form.
Validation
Native HTML constraints —
required,min,max,pattern,minLength,maxLength, and more - each with a custom message.Custom rules — Add any synchronous rule with
withCustomValidation.Async validation — Run asynchronous rules for server-side checks with
withCustomValidationAsync.Schema validation — Drive the whole form from one Standard Schema (Zod, Yup, Valibot, ArkType) - zero runtime dependencies.
Cross-field validation — Re-validate one field when another changes - like confirm-password - via
validatorDeps.
Structure & inputs
Deeply nested forms — Structure forms however you like, across any number of components.
Dynamic fields — Add or remove fields at runtime without losing state.
Real file inputs —
type="file"stores the realFileobject (orFile[]withmultiple), not theC:\fakepath\...string.
Platform & standards
Type-safe — Typed state,
toRawData(), and validators - all inferred from one form interface, no casts.Native <form> actions — Full browser-level submission -
action,method, and HTTP navigation - with no JavaScript required.Next.js Server Actions — Works through standard
<form>submissions, with no special adapters or client wiring.Accessibility-friendly — Automatically manages
aria-requiredandaria-invalidas validation state changes.React Native — The same model on web and mobile via
gform-react/native.
Ready to build better forms?
Install gform-react and ship type-safe, performant forms in minutes.
npm i gform-react