Formatic
Automatic forms.
Warning!
Formatic is currently early alpha and still in heavy development. Everything is
subject to change! You should probably just look away till this warning goes
away!
Start hacking
git clone git@github.com:zapier/formatic.git
cd formatic
npm install
gulp live
Point your browser to localhost:3000/index.html
. Hack away on the code,
and the browser will automatically reload with your changes.
Build
git clone git@github.com:zapier/formatic.git
cd formatic
npm install
gulp build
This will build two files: formatic-min.js (minified) and formatic-dev.js
(not minified and includes source maps for development).
What is formatic?
Formatic is a configurable, pluggable forms builder. Out of the box, it can
build React-based forms, but you can configure it and add/remove plugins to make
it work exactly how you want.
Using formatic (quick version)
If you don't want to extend formatic, you'll use it like this:
var formatic = require('formatic');
var form = formatic();
form.fields([
{
type: 'text',
key: 'firstName'
},
{
type: 'text',
key: 'lastName'
}
]);
form.set({
firstName: 'Joe',
lastName: 'Foo'
});
form.attach(document.body);
form.on('update', function () {
console.log(JSON.stringify(form.val()));
});
form.set('firstName', 'Joseph');