mui-form-generator-fractal-band-2
v1.0.43
Published
Form Builder for React Application with React Hook Form and Material-Ui
Downloads
49
Readme
mui-form-generator-fractal-band-2
Install
npm install --save mui-form-generator-fractal-band-2
Usage
import React from 'react'
import { Form, FormGenerator, FormButtons } from 'mui-form-generator-fractal-band-2'
const config = [
{
type: 'text',
name: 'name',
label: 'Name',
rules: {
required: 'Enter your name'
}
}
]
const Component = (props) => {
const onSubmit = (data) => {
console.log(data)
}
const onSubmitFail = (errors) => {
console.log(errors)
}
return (
<Form onSubmit={onSubmit} onSubmitFail={onSubmitFail}>
<FormGenerator config={config} />
<FormButtons />
</Form>
)
}
License
MIT © GingerBoy14