Skip to content

dipsywong98/reforml

Repository files navigation

reforml

react form defined by yaml

NPM JavaScript Style Guide size gh-action Codacy Badge coverage dependencies

Install

npm i reforml

Usage

https://dipsywong98.github.io/reforml/

import {BaseForm} from 'reforml'
import React, {useState, useMemo} from 'react'

export default () => {
  const [value, setValue] = useState({})
  const fields = useMemo(() => ({
    myField: {
      type: 'text',
      label: 'my field'
    }
  }), [])
  return (
    <BaseForm fields={fields} value={value} onChange={setValue}/>
  )
}

Development

yarn # install dependencies to all packages
yarn start # start the build watcher for reforml
yarn example # start the example
yarn docs # start the development server of documentation

License

MIT © dipsywong98