react-form-for
An expressive and intuitive form builder for React, in the style of Rails' form_for
example
var React = var Form Fields Field = var ListEditor = Components var DateField = var languages = var ExampleForm = React React
Custom field components
A possible implementation of the DateField
from the example above:
var React = var DateField = React moduleexports = DateField
Note the use of the important props value
, onChange
and label
which are
provided by the form builder. Other props such as help
are passed through from
the <Field />
proxy components used above.
Overriding the default field component
// as long as a component takes a `value` prop (and ideally a `label` prop)// and an `onChange` callback prop, it can be used as a react-form-for fieldvar Input = var Form Fields Field = var ExampleForm = React
Warning
⚠️ This module is pretty new and might have some bugs, please file an issue if you encounter any problems.