[](https://codecov.io/gh/data-driven-forms/react-forms)
[](https://circleci.com/gh/data-driven-forms/react-forms/tree/master)
[](https://badge.fury.io/js/%40data-driven-forms%2Freact-form-renderer)
[](https://twitter.com/intent/tweet?text=Check%20DataDrivenForms%20React%20library%21%20https%3A%2F%2Fdata-driven-forms.org%2F&hashtags=react,opensource,datadrivenforms)
[](https://twitter.com/DataDrivenForms)
[](https://data-driven-forms.org/)
Data Driven Forms is a React library used for rendering and managing forms with a lot of provided features based on [React Final Form](https://github.com/final-form/react-final-form).
:question: Why to use Data Driven Forms? :question:
- All forms **shared** the same **functionality**!
- Components are **controlled** in **one place**!
- You can **easily migrate** to different sets of components!
- All **functionality** is **provided** (see below!)
:tada: Features :tada:
- **Easily readable schema**, you don't need to know any HTML or JS to be able to write your own form schemas!
- You can use your **own components** or use one of our **provided mappers**: [PatternFly 4](https://patternfly-react.surge.sh/patternfly-4/), [Material-UI](https://mui.com/), [Ant Design](https://ant.design/)! and more, see below!)
- **Form state manager** out-of-the-box (including error states!)
- Fully **customizable** (you can use your own buttons, actions, etc.)!
- **Conditional** fields!
- Custom field **validation** with basic set included!
- **Datatype** validation!
- **Cross-field** validation!
- **Asynchronous** validation supported!
- Supporting **Wizard** forms!
- Supporting **[Final Form Field Array](https://github.com/final-form/react-final-form-arrays)!**
- ... and a lot more!
:book: For more information please visit the [documentation](https://data-driven-forms.org/). :book:
**Table of Contents**
- [Installation](#installation)
- [React Form Renderer](#react-form-renderer)
- [Provided mappers](#provided-mappers)
- [Material-UI Mapper](#material-ui-mapper)
- [PatternFly 4 Mapper](#patternfly-4-mapper)
- [BlueprintJS Mapper](#blueprintjs-mapper)
- [Semantic UI Mapper](#semantic-ui-mapper)
- [Ant Design Mapper](#ant-design-mapper)
- [Carbon Mapper](#carbon-mapper)
- [Basic provided components](#basic-provided-components)
- [Usage](#usage)
- [Custom mapper](#custom-mapper)
- [Documentation](#documentation)
- [Development setup](#development-setup)
- [Requirements](#requirements)
- [Common commands](#common-commands)
- [Install](#install)
- [Build](#build)
- [Run a playground](#run-a-playground)
- [Run documentation](#run-documentation)
- [How to clean node_modules](#how-to-clean-node_modules)
- [Cleaning built files](#cleaning-built-files)
- [Tests](#tests)
- [Checklist before you send a PR](#checklist-before-you-send-a-pr)
- [Build passes](#build-passes)
- [Linter passes](#linter-passes)
- [Write tests](#write-tests)
- [Documentation update](#documentation-update)
- [Correct commit message](#correct-commit-message)
- [Useful links](#useful-links)
- [Contribution](#contribution)
- [LICENSE](#license)
# Installation
## [React Form Renderer](https://www.npmjs.com/package/@data-driven-forms/react-form-renderer)
```console
$ npm install @data-driven-forms/react-form-renderer -S
```
```console
$ yarn add @data-driven-forms/react-form-renderer
```
## Provided mappers
### [Material-UI Mapper](https://data-driven-forms.org/mappers/mui-component-mapper)
```console
$ npm install @data-driven-forms/mui-component-mapper -S
```
```console
$ yarn add @data-driven-forms/mui-component-mapper
```
### [PatternFly 4 Mapper](https://data-driven-forms.org/mappers/pf4-component-mapper)
```console
$ npm install @data-driven-forms/pf4-component-mapper -S
```
```console
$ yarn add @data-driven-forms/pf4-component-mapper
```
### [BlueprintJS Mapper](https://data-driven-forms.org/mappers/blueprint-component-mapper)
```console
$ npm install @data-driven-forms/blueprint-component-mapper -S
```
```console
$ yarn add @data-driven-forms/blueprint-component-mapper
```
### [Semantic UI Mapper](https://data-driven-forms.org/mappers/suir-component-mapper)
```console
$ npm install @data-driven-forms/suir-component-mapper -S
```
```console
$ yarn add @data-driven-forms/suir-component-mapper
```
### [Ant Design Mapper](https://data-driven-forms.org/mappers/ant-component-mapper)
```console
$ npm install @data-driven-forms/ant-component-mapper -S
```
```console
$ yarn add @data-driven-forms/ant-component-mapper
```
### [Carbon Mapper](https://data-driven-forms.org/mappers/carbon-component-mapper)
```console
$ npm install @data-driven-forms/carbon-component-mapper -S
```
```console
$ yarn add @data-driven-forms/carbon-component-mapper
```
Component libraries in mappers are external dependencies. Make sure to install them and their styles in your bundles.
## Basic provided components
Provided mappers of Data Driven Forms support contains following set of components:
- [Text input](https://data-driven-forms.org/mappers/text-field?mapper=mui)
- [Text area](https://data-driven-forms.org/mappers/textarea?mapper=mui)
- [Checkbox](https://data-driven-forms.org/mappers/checkbox?mapper=mui) ([Multiple checkboxes](https://data-driven-forms.org/mappers/checkbox-multiple?mapper=mui))
- [Select (dropdown)](https://data-driven-forms.org/mappers/select?mapper=mui)
- [Dual list select](https://data-driven-forms.org/mappers/dual-list-select?mapper=mui)
- [Field array](https://data-driven-forms.org/mappers/field-array?mapper=mui)
- [Switch](https://data-driven-forms.org/mappers/switch?mapper=mui)
- [Radio buttons](https://data-driven-forms.org/mappers/radio?mapper=mui)
- [Date picker](https://data-driven-forms.org/mappers/date-picker?mapper=mui)
- [Time picker](https://data-driven-forms.org/mappers/time-picker?mapper=mui)
- [Tabs](https://data-driven-forms.org/mappers/tabs?mapper=mui)
- [Slider](https://data-driven-forms.org/mappers/slider?mapper=mui)
- [Sub-form](https://data-driven-forms.org/mappers/sub-form?mapper=mui)
- [Plain text](https://data-driven-forms.org/mappers/plain-text?mapper=mui)
- [Wizard](https://data-driven-forms.org/mappers/wizard?mapper=mui)
Any other components can be added to mapper and renderer with the form renderer. Existing components can be also overriden.
# Usage
In order to Data Driven Forms in your component you need the renderer and a component mapper, which provides component mapper and form template.
```jsx
import React from 'react';
import { FormRenderer, componentTypes } from '@data-driven-forms/react-form-renderer';
import { componentMapper, FormTemplate } from '@data-driven-forms/pf4-component-mapper';
const schema = {
fields: [{
component: componentTypes.TEXT_FIELD,
name: 'name',
label: 'Your name'
}]
}
const Form = () => (
{meta.error}
}