Design System

Component usage guide template

Browse Components

rhf

RHF Input

A React Hook Form input component with built-in error handling and validation support.

1. Import
Import the RHF Input component from the design system.
import { RHFInput } from "@/design-system/components/rhf";
2. Props
RHF Input component props.
PropTypeDefault
controlControl<T>--
namePath<T>--
registerUseFormRegister<T>--
callback(newValue: string) => void--
labelstring--
descriptionstring--
requiredbooleanfalse
wrapperClassNamestring--
labelClassNamestring--
descriptionClassNamestring--
errorClassNamestring--
3. Usages
Common RHF Input patterns and configurations.
import { RHFInput } from "@/design-system/components/rhf";
import { useForm } from "react-hook-form";

function Example() {
  const { control } = useForm({
    defaultValues: {
      email: "",
    },
  });

  return (
    <RHFInput
      control={control}
      register={register}
      name="email"
      type="email"
      placeholder="Enter your email"
    />
  );
}