2.0.21 • Published 10 months ago

mui-forms v2.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

About

Create beautiful advanced forms with a JSON-based schema

Advantages and features

  • Material UI components
  • Built-in layouting
  • Responsive
  • Support for custom components
  • Easily define field relationships and build advanced forms
  • Load data from API
  • Extensible
  • Simple forms
  • Wizard forms
  • Stepper forms
  • Mobile-ready
  • Production-ready

Installation

npm install mui-forms

Documentation

Visit the following page for detailed documentation: https://mui-forms.vercel.app

Basic Usage

1. Define your JSON schema

const exampleSchema = {
    "fields": [{
        "name": "first_name",
        "meta": {
            "displayType": "text",
            "displayName": "First Name"
        }
    }, {
        "name": "last_name",
        "meta": {
            "displayType": "text",
            "displayName": "Last Name"
        }
    }]
}

2. Usage

import React from 'react';
import MuiForms from 'mui-forms';
import exampleSchema from '<example-schema.json>';

export function MyForm() {
    return (
        <MuiForms
            schema={exampleSchema}
            onSubmit={(formData) => {
              // submit data
            }}
        />
    );
}

Input Properties

S.NoNameDescriptionType
1buttonsProvide custom button components for previous, next and submit actions for footer sectionMap of button names and button components
2classNameSets the value of class attribute of the root componentstring
3changeResponseModeIt configures data passed to onChange event. Available values:form-data section-datastring
4componentsCustom template components mapped with schema using displayType property as template. More detail in docs.Map of template names and components
5configProvide configuration options like spacing(gapX, gapY), size, tabs, variant. More detail in docs.Map of config names and values
6controlsCustom components mapped with schema using displayType propertyMap of displayType names and JSX components
7dataContains initial form data values with which form is loadedParsed JSON
8fnsA mapping of function names and functions which is referred inside schema by function nameMap of function name and function
9iconsContains a mapping of icons by nameMap of name and JSX element
10lastPageNumberSet the last number of a grouped form so that pages after the last page number are not considered and shownnumber
11loaderA custom component that overrides the default loader on next/submit actionReact Component
12nameName of the formstring
13nextResponseModeIt configures data needs that is passed to onNext event. Available values: form-data (passes all the form-data) page-date (passes only the current screen form-data in view) .string
14pageNumberThe page number with which a grouped form should open by default. If none specified, it is by default 1number
15restAPI configuration details. More detail in docs
16schema*JSON based schema containing all form fields details
17sectionLayoutAvailable values: default, stepper, tabs, wizards. More detail in docsstring
19onChangeA callback function called on each form field value changefunction
20onErrorA callback function called on each form field errorfunction
21onPreviousA callback function called on click of previous buttonfunction
22onNextA callback function called on click of next buttonfunction
23onSubmit*A callback function called on form submissionfunction
24onSubmtiErrorA callback function to be called whenever there is a submit errorfunction
25onPopupCloseA callback function to be called when popup's from certain form fields are closedfunction

Mandatory properties

  • schema
  • onSubmit

Schema details

Check out details here https://mui-forms.vercel.app/schema

Change logs

Contributions

Your contribution is very welcome and highly appreciated. To contribute, you can fork the repo, make your changes and submit a PR/MR to the master branch.

You can contribute in many ways:

  • Work on features/enhancements
  • Work on bug fixes
  • Improve on existing functionalities
  • Improve documentation
  • Add more examples/improve existing example
  • Participate in discussions
  • Provide your valuable feedback/suggestions.

Give a ⭐️ if you liked this project!

License

MIT © manojadams

2.0.9

11 months ago

2.0.8

1 year ago

2.0.15

10 months ago

2.0.16

10 months ago

2.0.13

11 months ago

2.0.14

11 months ago

2.0.11

11 months ago

2.0.12

11 months ago

2.0.10

11 months ago

2.0.19

10 months ago

2.0.17

10 months ago

2.0.18

10 months ago

2.0.20

10 months ago

2.0.21

10 months ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.3

1 year ago

2.0.4

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0-rc.1

1 year ago

1.0.40

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.26

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.15

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago