RHFDatePicker
RHFDatePicker extends the DatePicker component, allowing users to select a date with full support for customization and form integration.
Starting with version 4, this module also exports RHFDesktopDatePicker,
RHFMobileDatePicker, and RHFStaticDatePicker — variant components designed
for optimal usage across different screen sizes and device types.
Usage
import {
RHFDatePicker,
RHFDesktopDatePicker,
RHFMobileDatePicker,
RHFStaticDatePicker,
type RHFDatePickerProps,
type RHFDesktopDatePickerProps,
type RHFMobileDatePickerProps,
type RHFStaticDatePickerProps
} from '@nish1896/rhf-mui-components/mui-pickers/date';<RHFDatePicker
fieldName="dateOfBirth"
control={control}
/>Examples
API
RHFDatePickerProps extends DatePickerProps
and accepts the following additional props.
Props marked with * are required.
| Name | Type | Description |
|---|---|---|
fieldName* | string | Name of the field registered with React Hook Form. This prop is required for all components. |
control* | UseFormControl | |
registerOptions | RegisterOptions | React Hook Form validation rules. Useful when not using a schema validation library such as Yup or Joi. |
required | boolean | Indicates that the field is mandatory by adding an asterisk symbol (*) to the formLabel. This visual cue helps users quickly identify required fields in the form. |
customOnChange | ({ rhfOnChange, newValue, context }) => void | Custom change handler that overrides the default date value update behavior. Receives rhfOnChange, the updated date value, and the MUI picker change context. When provided, you must call rhfOnChange manually to update the form value. |
onValueChange | ({ newValue, context }) => void | Optional callback fired when the selected date changes and the picker value is valid. Receives the updated date value and the MUI picker change context. |
label | ReactNode | The text to render in the FormLabel component. By default, the value of fieldName is transformed (e.g., "firstName" to "First Name") using the fieldNameToLabel function. |
showLabelAboveFormField | boolean | Render form label above the form field in FormLabel component. |
formLabelProps | FormLabelProps | FormLabelProps to customise FormLabel component for a field. Multiple fields can be configured using the ConfigProvider component. |
hideLabel | boolean | Hides the FormLabel component if you don’t want to display the default form label component or prefer to render a fully custom label instead. |
renderError | (error: FieldError) => ReactNode | Custom renderer for the React Hook Form field error. Receives the current field error and returns the content to display, such as error.message or a custom React element in the HelperText component.Added in v4.1.0. |
hideErrorMessage | boolean | A flag to prevent replacement of helper text of a field by the errorMessage when the validation is triggered. |
helperText | ReactNode | The content to display within the FormHelperText component below the field. If the field validation fails, this content will be overridden by the corresponding error message. |
formHelperTextProps | FormHelperTextProps | FormHelperTextProps to customise FormHelperText component for a field. Multiple fields can be configured using the ConfigProvider component. |
customIds | { field, label, helperText, error } | Overrides the default field, label, helper text, and error IDs used for accessibility. |
Source Code
View the full implementation of this component on GitHub.

