You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-renderer-demo/src/pages/introduction.md
+30-7Lines changed: 30 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,24 @@ import CodeExample from '@docs/code-example';
5
5
6
6
# Data Driven Forms Introduction
7
7
8
-
Data Driven Forms converts JSON form definitions (schemas) into fully functional React forms with the provided set of features.
8
+
Data Driven Forms is a React library that renders a form and manages its state. Main features of this approach are:
9
9
10
-
## Form state management
11
-
12
-
Data Driven Forms uses [React Final Form](https://github.com/final-form/react-final-form) for the form state management. It is recommended to check their documentations first to fully understand how the [Data Driven Forms](https://github.com/data-driven-forms/react-forms) libraries work. However, it's not required to use DDF library.
10
+
- ○ **all components and form functionality is implemented in one place**, so all forms accross the whole application work and look the same,
11
+
- ○ **form schemas can be stored as a JSON value** and loaded dynamically from API,
12
+
- ○ **all forms are easily customizable and extendable** (for example, changing field from one component to another is just a matter of rewriting one string),
13
+
- ○ forms can be written by non-developer persons,
14
+
- ○ forms can be shared between different applications,
15
+
- ○ **Data Driven Forms implements [React Final Form](https://github.com/final-form/react-final-form)** as the form manager, so all advanced form features such as validation are available,
16
+
- ○ Data Driven Forms implements **custom form features such as conditions, actions, custom validators**, etc.
17
+
- ○ Data Driven Forms provides utitilites for writing complex components such as **Wizard, Dual List Selector or asynchronous select**.
To start implementing a form in Data Driven Forms, you need to provide four props:
15
21
16
-
[A schema](/schema/introduction) is a JSON object controlling the whole form. Using schema you define form fields and its attributes.
22
+
- ○ `onSubmit` a function that is called on submit,
23
+
- ○ `schema` a JSON object describing the form, [read more](/schema/introduction).
24
+
- ○ `componentMapper` a set of components used in the form, [custom one](/mappers/custom-mapper) or [one of the provided ones](/provided-mappers/component-api),
25
+
- ○ `FormTemplate`[a React component](/components/form-template) that structures and renders form fields and form buttons.
17
26
18
27
## How to start
19
28
@@ -23,8 +32,20 @@ Then you can import `FormRenderer` from the `@data-driven-forms/react-form-rende
23
32
24
33
Following example shows basic usage of Data Driven Forms library with our [Material UI mapper](/provided-mappers/mui-component-mapper).
Data Driven Forms uses [React Final Form](https://github.com/final-form/react-final-form) for the form state management. You can check their documentations first to fully understand how the [Data Driven Forms](https://github.com/data-driven-forms/react-forms) libraries work. However, it's not required to use DDF library.
46
+
47
+
---
48
+
28
49
## Articles
29
50
30
51
Following articles can give you more insights about Data Driven Forms and why/how to use it in you projects.
@@ -37,9 +58,11 @@ Following articles can give you more insights about Data Driven Forms and why/ho
37
58
38
59
[This article](https://medium.com/javascript-in-plain-english/data-driven-form-building-in-react-30768b49e625) presents basics of the data driven form building. It is a great point to start if you are new with this library.
39
60
61
+
---
62
+
40
63
## Comparison with other form libraries
41
64
42
-
### Form state management
65
+
### Form state managers
43
66
44
67
You can find many of already existing and well-established libraries such as Formik, React Hook Form, or React Final Form. These libraries are focused on providing form state management solutions. Data Driven Forms is using one of them - React Final Form - to enhance the developer experience and to provide consistent way for building complex forms. Form state management is completely abstracted in Data Driven Forms, so developers can focus on the only thing that really matters - building the most accessible web forms.
0 commit comments