
Product
A Fresh Look for the Socket Dashboard
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
material-form-builder
Advanced tools
In react, we are always involved in implementing a structure to receive information from the user The implementation of these structures may take us a lot of time My goal is to minimize this time You can create a branch of inputs with different structures with a few lines of code.
Material UI (^5.x.x) is available as an npm package.
npm install @mui/material @mui/x-date-pickers @mui/icons-material @emotion/react @emotion/styled dayjs
npm:
npm install material-form-builder
yarn:
yarn add material-form-builder
basic usage:
import React, { useRef } from 'react'
import { FormBuilder } from 'material-form-builder'
const App = () => {
const builderRef = useRef(null)
const getValues = () => {
const values = builderRef.current?.getValues()
}
const clear = () => {
builderRef.current?.clear()
}
return (
<Fragment>
<Box>
<FormBuilder
inputs={[
{
type: 'text',
selector: 'person_name',
label: 'Name',
},
{
type: 'text',
selector: 'person_family',
label: 'Family',
},
]}
ref={builderRef}
/>
</Box>
<Box mt={1}>
<Button color="success" onClick={getValues}>
Get
</Button>
<Button color="secondary" onClick={setValues}>
Set
</Button>
<Button color="primary" onClick={clear}>
clear
</Button>
</Box>
</Fragment>
)
}
key | description | link |
---|---|---|
inputs | inputs data | usage |
ref | react ref | - |
key | description | usage |
---|---|---|
getValues | get value data from form builder | usage |
setValues | set your data into inputs | usage |
clear | clear all inputs data | usage |
builderRef.current?.getValues()
usage:
{
data: {
person_name: 'ENTERED VALUE'
person_family: 'ENTERED VALUE'
},
validation: {
status: boolean,
inputs: []
}
}
builderRef.current?.setValues()
usage:
builderRef.current
?.setValues({
tid: 1,
person_name: 'john',
person_family: 'doe',
})
.then(() => {
console.log('all promises were fulfilled !')
})
builderRef.current?.clear()
usage:
builderRef.current?.clear().then(() => {
console.log('all promises were fulfilled !')
})
type | description | usage |
---|---|---|
text | text input | text input usage |
number | number input | number input usage |
checkbox | checkbox input | checkbox input usage |
password | password input | password input usage |
autocomplete | autocomplete input | autocomplete input usage |
mobile | mobile input | mobile input usage |
otp | otp input | otp input usage |
mask | mask input | mask input usage |
date | date input | date input usage |
time | time input | time input usage |
datetime | datetime input | datetime input usage |
file | file input | file input usage |
items | items input | items input usage |
custom | custom input | custom input usage |
key | type | description | sample |
---|---|---|---|
selector | string | - | - |
defaultValue | Input Value Type | - | - |
required | boolean | - | - |
visible | boolean | - | - |
wrapper | function | - | - |
onChangeValue | function | - | - |
getMutator | function | - | - |
setMutator | function | - | - |
This project is licensed under the terms of the MIT license.
FAQs
FormBuilder For React.js
The npm package material-form-builder receives a total of 9 weekly downloads. As such, material-form-builder popularity was classified as not popular.
We found that material-form-builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
Industry Insights
Terry O’Daniel, Head of Security at Amplitude, shares insights on building high-impact security teams, aligning with engineering, and why AI gives defenders a fighting chance.
Security News
MCP spec updated with structured tool output, stronger OAuth 2.1 security, resource indicators, and protocol cleanups for safer, more reliable AI workflows.