Formulate
Formuate is a schema-driven React Forms Library for building ui agnostic forms.
Quick start Example
See this demo in action at https://codesandbox.io/s/formulate-example-l95mp
;; ;
What is Formulate?
Formulate is a schema-driven React Forms Library that is UI agnostic (works out of the box with ant-design, material-ui, blueprintjs), type-safe for both Typescript and Flow, and easy on the eyes. The biggest selling point to Formulate is that enables you keep your form schema and your form markup separate.
Formulate handles your form's state manage and error validation, and does so with industry standard best practices built in. Never worry about error display strategies again 🧪
How does it work?
If you prefer to learn by example, check out this sandbox: (https://codesandbox.io/s/formulate-example-l95mp)
Otherwise, this section will walk you through how Formulate to get started with Formulate:
Defining your Schema
The form schema dictates what fields your form will have, the shape of your form's data, and how validation is performed on each of your form inputs. There are two top level APIs you'll use when building a form schema: FormInput
and FormArrayInput
.
After defining your form schema, pass it into useForm
to access your form state and input bindings.
Now all that's left is to hook up for form bindings and data to your JSX markup! This separation of form state and markup is what allows Formulate to be design-system agnostic.
return ;
That's it! Happy hacking! 🧪
Install
npm install -S formulate