Skip to content

This package is a simple bridge between react-hook-form and material-ui

License

Notifications You must be signed in to change notification settings

BigChicChicken/react-hook-form-material-ui

Repository files navigation

react-hook-form-material-ui

NPM

This package is a simple bridge between react-hook-form and material-ui

DOC

Install

npm install react-hook-form-material-ui
# or
yarn add react-hook-form-material-ui

Usage

import React from 'react'
import Button from '@mui/material/Button'
import { Form, TextField } from 'react-hook-form-material-ui'
import { FormControl } from "@mui/material";

const App = () => {
  const handleSubmit = (data) => {
    console.info("Data submitted:")
    console.info(data)
  }

  return <>
    <Form
      parameters={{
        defaultValues: {
          textField: 'My TextField'
        }
      }}
      onSubmit={handleSubmit}
    >
      <TextField
        name="textField"
        textFieldProps={{ label: "TextField" }}
      />

      <FormControl>
        <Button type="submit" variant="contained">Submit</Button>
      </FormControl>
    </Form>
  </>
}

License

This is completely free and released under the MIT License.

About

This package is a simple bridge between react-hook-form and material-ui

Resources

License

Stars

Watchers

Forks

Packages

No packages published