Introduction
Easily build forms in minutes using the popular React Hook Form library alongside Material-UI.
This package provides a suite of 25+ reusable and customizable components specifically designed to simplify form creation. Each component handles form binding and UI rendering logic internally, minimizing code duplication and giving developers the flexibility to style form form fields to match their website's design guidelines.
You can also find additional components in this package, such as color picker and phone input, that are not currently part of Material UI but can be useful when you need them. More components will be added based on community feedback. Feel free to raise a feature request or report a bug by contacting the author of this package.
Installation
To get started, install the following packages:
npm install react-hook-form@^7 @mui/material@^9 @mui/icons-material@^9 @nish1896/rhf-mui-components@^5yarn add react-hook-form@^7 @mui/material@^9 @mui/icons-material@^9 @nish1896/rhf-mui-components@^5pnpm add react-hook-form@^7 @mui/material@^9 @mui/icons-material@^9 @nish1896/rhf-mui-components@^5You can refer to the Material UI installation guide for installation instructions.
For date pickers, follow the installation guide to install @mui/x-date-pickers.
Still on an earlier MUI major? Pick the matching package version from the table below and follow that version's introduction page instead.
Optional: If you are using a third party library for form validation, say joi, make sure to install its npm package along with the @hookform/resolvers package.
npm install @hookform/resolvers@^5 joi@^18yarn add @hookform/resolvers@^5 joi@^18pnpm add @hookform/resolvers@^5 joi@^18Usage with Webpack
This package is ESM-only.
If you're using React with Webpack and encounter module resolution errors,
add the following rule to your webpack.config.js:
module.exports = {
module: {
rules: [
{
test: /\.m?js$/,
resolve: {
fullySpecified: false
}
}
]
}
}Version Compatibility
The table below outlines this package's compatibility with various versions of @mui/material and @mui/x-date-pickers.
| Package Version | MUI Versions | @mui/x-date-pickers Versions |
|---|---|---|
v5 (current) | v9 | v9 |
v4 | v6, v7 | v7, v8 |
v3 (maintenance) | v5, v6, v7 | v6, v7, v8 |
v2 (deprecated) | v5, v6 | v6, v7 |
v1 (deprecated) | v5 | v6 |

