Skip to content
Travis Tidwell edited this page Mar 25, 2017 · 17 revisions

This library includes 2 major components.

  • JavaScript API - This component allows you to easily communicate to the Form.io API's from within your JavaScript application, like so.

    import Formio from 'formiojs';
    let formApi = new Formio('https://examples.form.io/example');
    formApi.loadForm().then(function(form) {
      console.log(form)
    });
  • Form Renderer - This is the core form rendering library which renders a Form.io JSON form schema within your page.

    import FormioForm from 'formiojs/form';
    let form = new FormioForm(document.getElementById('formelement'));
    form.src = 'https://examples.form.io/example';
  • Form Utilities - This is a Utility javascript library that offers some common utilities within your application.

import Formio from 'formiojs';
import FormioUtils from 'formiojs/utils';

let form = new Formio('https://examples.form.io/example');
form.loadForm().then((form) => {
  FormioUtils.eachComponent(form.components, (component) => {
    console.log(component);
  });
});
Clone this wiki locally