formin
Primitive for building forms in react
I built formin to serve as a tiny (~1.5kb) alternative to other form solutions in react with these goals in mind
- Simple API
- Tiny size
- Work great with native HTML form validation
- Great a11y support
- Extendable
Install
$ npm install formin
You can also play around with it in CodeSandbox.io.
Usage
Hook
{ const getInputProps getFormProps = return <form ...> <input ... /> <input ... /> <button>Submit</button> </form> }
Render prop
{ return <Formin onSubmit= { console } > <form ...> <input ... /> <input ... /> <button>Submit</button> </form> </Formin> }
Docs
Other solutions
This library is heavily inspired by Formik but takes a different approach to the problem.