@ekz/formix
v2.1.2
Published
Type-safe React form to be used with Typescript
Maintainers
Readme
@ekz/formix
Type-safe React forms for TypeScript.
Documentation: https://docs.ekz.io/formix/
Install
npm install @ekz/formix @ekz/option immutable reactQuick example
import { defineField, useField, useForm, withForm } from '@ekz/formix';
const fields = { name: defineField('') };
function NameForm() {
const { value, setValue } = useField(fields.name);
const { valid } = useForm();
return (
<input value={value} onChange={(e) => setValue(e.target.value)} />
);
}
export const NameFormWithContext = withForm(NameForm);See the docs for validation, array fields, and form shell patterns.
