A React component for rendering out forms based on the Form.io platform.
React Formio
can be used on the server, or bundled for the client using an
npm-compatible packaging system such as Browserify or
webpack.
npm install react-formio --save
The browser bundle exposes a global Formio
variable and expects to find
a global React
variable to work with.
You can find it in the /dist directory.
Give Form
a src
property and render:
** For es5 require() modules. **
var React = require('react');
var ReactDOM = require('react-dom');
var Form = require('react-formio').Form;
** For es6 import/export modules. **
import React from 'react';
import ReactDOM from 'react-dom';
import {Form} from 'react-formio';
ReactDOM.render(
<Form src="https://example.form.io/example" />
, document.getElementById('example')
);
See the src folder for all the available Props.
The FormBuilder class can be used to embed a form builder directly in your react application. Please note that you'll need to include the CSS for the form builder from formio.js as well.
** For es6 import/export modules. **
import React from 'react';
import ReactDOM from 'react-dom';
import {FormBuilder} from 'react-formio';
ReactDOM.render(
<FormBuilder form={{display: 'form'}} onChange={(schema) => console.log(schema)} />
, document.getElementById('builder')
);
See the src folder for all the available Props.
Released under the MIT License.