mui-easy-form
TypeScript icon, indicating that this package has built-in type declarations

0.10.4 • Public • Published

Combine Material UI and React Hook Form

TEST

Features

  • typescript support
  • native support with material-ui & react-hook-form
  • extend material-ui components
  • provide uncontrolled & controlled components

Install

  • npm install mui-easy-form
  • yarn add mui-easy-form
  • pnpm install mui-easy-form

QuickStart

import { Button } from '@mui/material'

type User = {
  id: string
  name: {
    first: string
    last: string
  }
}

function App() {
  const { handleSubmit, control } = useForm<User>()
  return (
    <form
      noValidate
      onSubmit={handleSubmit((data) => {
        console.log(data)
      })}
    >
      <TextField<Shape>
        control={control}
        label="text"
        required
        name="name.first"
      />
      <Button type="submit">submit</Button>
    </form>
  )
}

Documentation

demo

Component List

  • [x] word
  • [x] password
  • [x] number

TODO

  • [ ] codesandbox
  • [ ] i18n
  • [ ] reduce size
  • [ ] FAQ: "XXIO" difference with "XXField"?
  • [ ] eslint

Package Sidebar

Install

npm i mui-easy-form

Weekly Downloads

1

Version

0.10.4

License

MIT

Unpacked Size

351 kB

Total Files

59

Last publish

Collaborators

  • sweet.orange