rhf
RHF Time Picker
React Hook Form wrapper cho Time Picker vá»›i há»— trợ validation và error handling tÃch hợp.
1. Import
Import the RHF Time Picker component from the design system.
import { RHFTimePicker } from "@/design-system/components/rhf";2. Props
RHF Time Picker component props.
| Prop | Type | Default |
|---|---|---|
| control | Control<T> | -- |
| name | Path<T> | -- |
| label | string | -- |
| showSeconds | boolean | true |
| className | string | -- |
| wrapperClassName | string | -- |
| required | boolean | false |
3. Usages
Các pattern và cấu hình RHFTimePicker phổ biến.
09:30:00
import { RHFTimePicker } from "@/design-system/components/rhf";
import { useForm } from "react-hook-form";
function Example() {
const { control } = useForm({
defaultValues: {
time: "09:30:00",
},
});
return (
<RHFTimePicker
control={control}
name="time"
label="Time"
/>
);
}