@synapsestudios/form-schema

1.6.0 • Public • Published

form-schema

A library for building and exporting a form schema that can be used to generate dynamic forms

Usage

const FormSchema = require('@synapsestudios/form-schema');
const formSchema = new FormSchema();

// addField with string args. Requires a name and a type
formSchema.addField('name', 'hidden');

// addField with object arg. Requires a name and a type
formSchema.addField({
  name: 'some-great-field',
  type: 'text',
  label: 'Some Greate Field',
  value: 'This is a cool field!',
});

// get the form schema as a plain old javascript object
const schema = formSchema.getFormSchema();

// remove a field by name
formSchema.removeField('some-great-field');

Development

git clone git@github.com:synapsestudios/form-schema.git
cd form-schema
yarn install

Readme

Keywords

none

Package Sidebar

Install

npm i @synapsestudios/form-schema

Weekly Downloads

129

Version

1.6.0

License

MIT

Last publish

Collaborators

  • morio_sum
  • chestercharles
  • bobeagan
  • tdboone
  • synzach
  • nearengine
  • spruce-bruce
  • areida
  • agerbens
  • averhulst