@arudovwen/form-builder-react 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  The **Form Builder Package** is a reusable library designed to simplify the creation and management of dynamic forms in web applications. It provides a robust API and customizable components to streamline form-building workflows.
5
5
 
6
- **This package is still in development**
6
+ > **Note**: This package is still in development.
7
7
 
8
8
  ## Features
9
9
 
@@ -20,10 +20,17 @@ Install the package via npm:
20
20
  ```bash
21
21
  npm install @arudovwen/form-builder-react
22
22
  ```
23
+
23
24
  ## Demo
24
25
 
25
- Check out the live demo of the Form Builder Package: [Form Builder Demo](https://form-builder-inky-nine.vercel.app/),
26
- To view after saving : [Form Viewer ](https://form-builder-inky-nine.vercel.app/viewer)
26
+ Explore the live demo of the Form Builder Package:
27
+ - [Form Builder Demo](https://form-builder-inky-nine.vercel.app/)
28
+ - [Form Viewer](https://form-builder-inky-nine.vercel.app/viewer)
29
+
30
+ ## GitHub Repository
31
+
32
+ Find the source code and contribute to the project on GitHub:
33
+ [Form Builder GitHub Repository](https://github.com/arudovwen/Form.Builder)
27
34
 
28
35
  ## Usage
29
36
 
@@ -34,7 +41,6 @@ import React, { useState, useEffect } from "react";
34
41
  import { FormBuilder, FormViewer } from "@arudovwen/form-builder-react";
35
42
  import "@arudovwen/form-builder-react/dist/index.css";
36
43
 
37
-
38
44
  function App() {
39
45
  const [formData, setFormData] = useState(null);
40
46
  const [loading, setLoading] = useState(true);
@@ -61,28 +67,23 @@ function App() {
61
67
  };
62
68
 
63
69
  return (
64
-
65
- <>
66
- <FormBuilder
67
- onSubmit={(form_data: any) => console.log(form_data)}
68
- config={config}
69
- />
70
-
71
-
72
- <FormViewer
73
- onSubmit={(e: any) => console.log(e)}
74
- form_data={formData}
75
- anwserData={answerData}
76
- config={config}
77
- loading={loading}
78
- />
79
- </>
80
-
70
+ <>
71
+ <FormBuilder
72
+ onSubmit={(form_data: any) => console.log(form_data)}
73
+ config={config}
74
+ />
75
+ <FormViewer
76
+ onSubmit={(e: any) => console.log(e)}
77
+ form_data={formData}
78
+ answerData={[]}
79
+ config={config}
80
+ loading={loading}
81
+ />
82
+ </>
81
83
  );
82
84
  }
83
85
 
84
86
  export default App;
85
-
86
87
  ```
87
88
 
88
89
  ### Props for `FormBuilder`
@@ -90,11 +91,12 @@ export default App;
90
91
  | Prop | Type | Description |
91
92
  |--------------|--------------------|--------------------------------------------------|
92
93
  | `form_data` | `FormElement[]` | Array of form elements to render in the form. |
93
- | `anwserData` | `any[]` | Array of user-provided answers to the form. |
94
+ | `answerData` | `any[]` | Array of user-provided answers to the form. |
94
95
  | `config` | `object` | Configuration object (e.g., `buttonColor`, `loaderColor`). |
95
96
  | `onSubmit` | `(data: any) => void` | Callback function triggered when the form is submitted. |
96
97
  | `loading` | `boolean` | Indicates whether the form is in a loading state. |
97
98
  | `isReadOnly` | `boolean` | Determines if the form is rendered in read-only mode. |
99
+ | `renderType` | `string` | Determines the style the form is rendered, either `multi` or `single`. |
98
100
 
99
101
  ### Form Element Types
100
102
 
@@ -114,8 +116,8 @@ To contribute or modify the package:
114
116
  1. Clone the repository:
115
117
 
116
118
  ```bash
117
- git clone https://github.com/your-username/form-builder.git
118
- cd form-builder
119
+ git clone https://github.com/arudovwen/Form.Builder.git
120
+ cd Form.Builder
119
121
  ```
120
122
 
121
123
  2. Install dependencies:
@@ -160,4 +162,4 @@ Contributions are welcome! Please fork the repository, create a feature branch,
160
162
  ---
161
163
 
162
164
  Happy form building!
163
- ```
165
+