Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 1.58 KB

RHFNumberInput.mdx

File metadata and controls

46 lines (35 loc) · 1.58 KB
sidebar_position sidebar_label title description
2
Number Input
RHFNumberInput
RHFNumberInput is a specialized version of RHFTextField, designed to accept only integer or decimal values as input.

import { RHFNumberInputPropsTable } from '@site/src/page-components'; import { AvailabilityBanner } from '@site/src/components'; import NewImg from '@site/static/img/new.png';

RHFNumberInputNEW

RHFNumberInput is an enhanced version of the TextField component which accepts only integer or float values. It retains the core functionality, styling options, and flexibility of the TextField, while seamlessly integrating with react-hook-form for number-specific input handling.

Usage

import RHFNumberInput, { RHFNumberInputProps } from '@nish1896/rhf-mui-components/mui/number-input';

To render a fully functional RHFNumberInput, you only need 3-4 essential props.

<RHFNumberInput
  fieldName="age"
  control={control}
  errorMessage={errors?.age?.message}
/>

Examples

API

The RHFNumberInputProps interface extends TextFieldProps and includes the following additional props: