@rhf-kit/mui
TypeScript icon, indicating that this package has built-in type declarations

1.4.6 • Public • Published

@rhf-kit/mui

NPM Version NPM Downloads NPM Dependents Build Commitizen friendly Types

× DOCS ×


@rhf-kit/mui is a library of Material-UI components integrated with React Hook Form to provide seamless form control to your React apps.

Install

npm i @rhf-kit/mui

@rhf-kit/mui requires the following peer dependencies:

  • react ^18.2.0
  • react-hook-form ^7.51.3
  • @mui/icons-material ^5.15.15
  • @mui/material ^5.15.15
  • @mui/x-date-pickers ^7.2.0

Components

Usage

import { FormContainer, FormButton, FormTextFieldElement } from "@rhf-kit/mui";

interface IFormData {
  firstName: string;
}

const Example = () => {
  const onSubmit = (data: IFormData) => console.log(data);
  const defaultValues: IFormData = {
    firstName: "",
  };

  return (
    <FormContainer defaultValue={defaultValues} onSubmit={onSubmit}>
      <FormTextFieldElement name="firstName" label="First Name" />
      <FormButton>Submit</FormButton>
    </FormContainer>
  );
};

Readme

Keywords

Package Sidebar

Install

npm i @rhf-kit/mui

Weekly Downloads

43

Version

1.4.6

License

MIT

Unpacked Size

66.9 kB

Total Files

119

Last publish

Collaborators

  • joeduncko
  • nicolasjott