JavaScript Frameworks

A list of all the Progressive Web Application frameworks supported by the Form.io platform.

JavaScript

At its core, the Form.io platform uses a plain JavaScript (aka Vanilla JavaScript) renderer to render the forms within an application. This renderer, as well as all documentation, can be found on Github @ https://github.com/formio/formio.js. For the full documentation, please take a look at Form Renderer Documentation in the help guides.

This renderer is able to easily render a form using the following code within your application either via Script embedding or application embedding.

Script Embedding

This allows the embedding of a form directly within an HTML application using the script tags within the header. The scripts and CSS that need to be included are as follows.

Navigate to the following link for more information about the Form.io CDNs

<html>
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css">
    <script src="https://cdn.form.io/js/formio.embed.js"></script>
  </head>
  <body>
    <div id='formio'></div>
    <script type='text/javascript'>
      Formio.createForm(
        document.getElementById('formio'), 
        'https://examples.form.io/example'
      );
    </script>
  </body>
</html>

The Form Builder can also be embedded using the following code.

Application Embedding

The form renderer can also be embedded within an application by first including the formiojs renderer as an NPM dependency and then using the following code.

And the following CSS should also be included in your application SASS file.

For more documentation on the JavaScript renderer, please check out the following links.

Angular

The Angular framework is a very popular PWA framework offered by Google. The Form.io integration libraries provide a simple wrapper around the JavaScript renderer library but expose a number of helper components and modules that enable rapid application development within the Angular framework.

Angular Renderer

Compatibility Version Matrix

To use this within your application, you will start by importing the dependencies via NPM.

Once the library is imported into your Angular application, you can render a form using the following code.

And then the following can be used within your templates to render a form.

There are many other modules and helper components within the Angular library, so we recommend checking out the list of other documentation and examples at the following links.

Angular Demo Application

Angular Other Resources

React

React is a popular JavaScript library for building PWA applications. It is maintained by Facebook. The Form.io integration libraries provide a simple wrapper around the JavaScript renderer library but expose a number of helper components and modules that enable rapid application development within React.

React Renderer

To use this within your application, you will start by importing the dependencies via NPM.

Once the library is imported into your React application, you can render a form using the following code.

There are many other modules and helper components within the React library, so we recommend checking out the list of other documentation and examples at the following links.

React Starter Application

React Components vs Form.io Components

React and Form.io both use the word "components" to refer to discreet modules of reusable code, but they are distinctly different and the difference must be understood.

In React, components are UI building blocks that render elements on the page, while in Form.io, components are data-driven form elements that power dynamic forms, workflows, and APIs. Form.io components are not just the data field UI, they define data structures, validation, and API interactions, to create a fully integrated form and data management system.

React Wrapper

Form.io provides a React wrapper that makes embedding forms in a React application completely seamless. Developers should not try to import custom React components directly into Form.io forms. Instead, use the React wrapper to integrate the rendered forms seamlessly alongside any other React component. This allows for tight integration with React’s state management, event handling, and styling, while still benefiting from the Form.io Platform's schema-driven approach.

Integrating forms with the React wrapper

Rather than treating the Form.io Platform as an isolated system, the React wrapper integrates a React app and the Form.io form engine. Forms may trigger React state updates, listen to events, and interact with other components in the app without breaking the schema-driven approach of Form.io

This ensures:

  • Separation of concerns: Control of the broader application’s UI is handled entirely by React, while the the form’s behavior is handled entirely with the Form.io Platform.

  • Scalability: The app remains scalable without needing to modify form components at the code level.

  • Flexibility: The Form.io Platform's JSON-driven forms stay flexible and dynamic while still aligning with the application’s design system.

Vue

The Form.io Vue renderer allows integration with the popular Vue.js framework.

Vue Renderer

To use this within your application, you will start by importing the dependencies via NPM.

Once the library is imported into your Vue application, you can render a form using the following code.

Form components provide many helpful properties which allow you to configure your form. Here are the most common of them.

Property
Description
Value example

src

An embed URL to load a form

form

Form JSON schema, can be used instead of the src

{

type: 'form', display: 'form',

components: [...],

}

submission

Submission to set when the form is loaded

{ data: {...}, state: 'submitted', }

options

Form options

{ readOnly: true, noAlerts: false, saveDraft: false, }

There are many other modules and helper components within the Vue library, so we recommend checking out the list of other documentation and examples at the following links.

Vue Starter Application

Last updated

Was this helpful?