Design System

Component usage guide template

Browse Components

rhf

RHF Date Picker

React Hook Form wrapper cho DatePicker với hỗ trợ validation và error handling tích hợp.

1. Import
Import the RHF Date Picker component from the design system.
import { RHFDatePicker } from "@/design-system/components/rhf";
2. Props
RHF Date Picker component props.
PropTypeDefault
controlControl<T>--
namePath<T>--
callback(value: Date | undefined) => void--
labelstring | React.ReactNode--
requiredbooleanfalse
errorstring--
classNamestring--
3. Usages
Các pattern và cấu hình RHFDatePicker phổ biến.
import { RHFDatePicker } from "@/design-system/components/rhf";
import { useForm } from "react-hook-form";

function Example() {
  const { control } = useForm({
    defaultValues: {
      date: undefined,
    },
  });

  return (
    <RHFDatePicker
      control={control}
      name="date"
      label="Date"
      placeholder="Pick a date"
    />
  );
}