# react-form-builder
**Repository Path**: lingjun2016/react-form-builder
## Basic Information
- **Project Name**: react-form-builder
- **Description**: A complete react form builder that interfaces with a json endpoint to load and save generated forms. The toolbox contains 16 items for gathering data.
- **Primary Language**: JavaScript
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 2
- **Created**: 2019-09-27
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
[](https://www.npmjs.com/package/react-forms-builder)
[](https://travis-ci.org/blackjk3/react-form-builder)
# React Form Builder 2
A complete react form builder that interfaces with a json endpoint to load and save generated forms.
- Upgraded to React 16.x.x
- Use react-dnd for Drag & Drop
- Save form data with dummy api server.

### Editing Items

# Basic Usage
```javascript
var React = require('react');
var FormBuilder = require('react-forms-builder');
React.render(
,
document.body
)
```
# Props
Toolbar._defaultItems
```javascript
var items = [{
key: 'Header',
name: 'Header Text',
icon: 'fa fa-header',
static: true,
content: 'Placeholder Text...'
},
{
key: 'Paragraph',
name: 'Paragraph',
static: true,
icon: 'fa fa-paragraph',
content: 'Placeholder Text...'
}];
```
# React Form Generator
Now that a form is built and saved, let's generate it from the saved json.
```javascript
var React = require('react');
var FormBuilder = require('react-forms-builder');
React.render(
,
document.body
)
```
### Form Params
Name | Type | Required? | Description
--- | --- | --- | ---
form_action | string | Required | URL path to submit the form
form_method | string | Required | Verb used in the form submission.
action_name | string | Optional | Defines form submit button text. Defaults to "Submit"
data | array | Required | Question data retrieved from the database
download_path | string | Optional | used in File Download
upload_path | string | Optional | used in File Upload
back_action | string | Optional | URL path to go back if needed.
back_name | string | Optional | Button text for back action. Defaults to "Cancel".
task_id | integer | Optional | User to submit a hidden variable with id to the form on the backend database.
answer_data | array | Optional | Answer data, only used if loading a pre-existing form with values.
authenticity_token | string | Optional | If using Rails and need an auth token to submit form.
hide_actions | boolean | Optional | If you would like to hide the submit / cancel buttons set to true.
display_short | boolean | Optional | Display an optional "shorter page/form" which is common for legal documents or situations where the user will just have to sign or fill out a shorter form with only the critical elements.
read_only | boolean | Optional | Shows a read only version which has fields disabled and removes "required" labels.
variables | object | Optional | Key/value object that can be used for Signature variable replacement.
### Form Elements


### Form Elements Props
Name | Type | Required? | Description
--- | --- | --- | ---
# Vendor Dependencies
In order to make the form builder look pretty, there are a few dependencies other than React. See the example code in index.html for more details.
- Bootstrap
- FontAwesome
- jQuery
# SASS
All relevant styles are located in css/application.css.scss.
# DEMO
```bash
$ npm install
$ npm start
$ npm serve:api
```
Then navigate to http://localhost:8080/ in your browser and you should be able to see the form builder in action.