Skip to content

kendaganio/toguro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toguro · Build Status

Turn your JSON to 100% working forms.


Toguro in his 100% form.

Install

via package managers

yarn add toguro
npm i toguro

via a CDN

<link rel="stylesheet" href="https://unpkg.com/toguro/dist/toguro.js"/>

Usage

You need to provide a JSON Schema

var schema = {
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "title": "Name",
    },
    "age": {
      "type": "integer",
      "title": "Age",
    },
    "description": {
      "type": "string",
      "title": "Description",
    }
  },
  "required": [
    "name"
  ]
}

Instantiate and render

var toguro = new Toguro({
  schema: schema,
  submit: (formData) => { console.log(formData) }
})

toguro.renderTo(document.getElementById("some-id"))