0.0.1 • Published 4 years ago

disform v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Disform

Forms don't get better than dis

Install

npm install --save disform

Usage

import { useField, useForm } from "disform"

function Example() {
  let color = useField({ defaultValue: "" })

  let form = useForm({
    fields: [color],
    onSubmit() {
      // ...
    },
  })

  return (
    <form onSubmit={form.onSubmit}>
      <label {...color.labelProps}>Favorite Color</label>
      <input type="text" {...color.inputProps} />
      <button type="submit">Submit</button>
    </form>
  )
}