![Logo](./.github/Logo.svg) ![Version](https://badgen.net/npm/v/formhero) ![Dependencies](https://badgen.net/david/dep/cupcakearmy/formhero) ![Size Badge](https://badgen.net/bundlephobia/minzip/formhero) **Fully customisable react form utility.** ## 🌈 Features - Typescript compatible - Customizable extractor, validator, getter and setters. (More in the docs) - No Deps - Tiny ## 🚀 Quickstart ```typescript import ReactDOM from 'react-dom' import { useForm } from 'formhero' const Form = () => { const { auto, form, errors } = useForm({ username: '', password: '', type: 'formhero', awesome: true, }, { username: /^test/, password: { validator: /^.{3,}$/, message: 'To short', }, awesome: (value) => !!value }) const _submit = (e: React.FormEvent) => { e.preventDefault() console.log(form, errors) } return (
Username
{errors.username && 'Something went wrong'}
Password

Which one to choose?

Is it awesome?
e.target.checked })} />
) } ``` ## 📖 Docs ### `useForm` ```typescript const {auto, errors, update, form} = useForm(initial, validators, options) ```