0.4.4 • Published 2 months ago

form-sculpt v0.4.4

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 months ago

Form Sculpt

A React package to generate dynamic forms

Installation

Please Install These packages before moving to form-sculpt

npm i @emotion/react @emotion/styled @hookform/resolvers @mui/material moment react-hook-form yup

or

yarn add @emotion/react @emotion/styled @hookform/resolvers @mui/material moment react-hook-form yup

Then install our package

npm i form-sculpt

or

yarn add form-sculpt

Example

Generate Json Schema

Create a Json Schema for your form

  const schema = [
    {
      fieldWidth: 1 / 3,
      key: "PersonalDetails",
      fieldLabel: {
        label: "Personal Details",
        placeholderText: "Personal Details",
        description: "some description about the field",
      },
      fieldType: "title",
      isRequired: true,
    },
    {
      fieldWidth: 1 / 2,
      key: "Des",
      fieldLabel: {
        label: "Enter Your Personal Details for data collection",
        placeholderText: "Enter Your Personal Details for data collection",
        description: "Enter Your Personal Details for data collection",
      },
      fieldType: "description",
      isRequired: true,
    },
    {
      fieldWidth: 1 / 2,
      key: "firstName",
      fieldLabel: {
        label: "First Name",
        placeholderText: "Enter First Name",
        description: "some description about the field",
      },
      fieldType: "textField",
      isRequired: true,
    },
    {
      fieldWidth: 1 / 2,
      key: "lastName",
      fieldLabel: {
        label: "Last Name",
        placeholderText: "Enter Last Name",
        description: "some description about the field",
      },
      fieldType: "textField",
      isRequired: true,
    },
    {
      fieldWidth: 1,
      key: "address",
      fieldLabel: {
        label: "Personal Address",
        placeholderText: "Enter Personal Address",
        description: "some description about the field",
      },
      fieldType: "textArea",
      isRequired: true,
    },
  ];

Generating Form From Json Schema

pass the schema you made and the onSubmit funtion for generating the form

import Form from "./Form";

const App = () => {

  return (
    <div>
      <Form schema={schema} onSubmit={(d) => console.log(d)} />
    </div>
  );
};

export default App;
0.4.4

2 months ago

0.4.3

2 months ago

0.4.2

2 months ago

0.4.1

3 months ago

0.4.0

4 months ago

0.3.20

8 months ago

0.3.21

7 months ago

0.3.19

8 months ago

0.3.18

8 months ago

0.3.17

8 months ago

0.3.16

8 months ago

0.3.15

9 months ago

0.0.0

8 months ago

0.3.14

9 months ago

0.3.13

10 months ago

0.3.12

10 months ago

0.3.11

10 months ago

0.3.10

10 months ago

0.3.9

11 months ago

0.3.8

11 months ago

0.3.7

11 months ago

0.3.6

11 months ago

0.3.5

11 months ago

0.3.4

11 months ago

0.3.3

11 months ago

0.3.2

11 months ago

0.3.1

11 months ago

0.3.0

11 months ago

0.2.9

11 months ago

0.2.8

11 months ago

0.2.7

11 months ago

0.2.4

11 months ago

0.2.3

11 months ago

0.2.2

11 months ago

0.2.1

11 months ago

0.1.10

12 months ago

0.1.9

12 months ago

0.1.8

12 months ago

0.1.7

12 months ago

0.1.6

12 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago