DateField
DateField wraps Ant Design's DatePicker with React Hook Form, supporting ISO date string serialization and custom formats.
Props & Configuration
5 propsComplete property specifications, parameter types, and default fallbacks.
| Property | Type | Default | Description |
|---|---|---|---|
| idRequired | string | — | Form state key name. |
| controlRequired | Control<any> | — | React Hook Form control instance. |
| label | string | — | Field label. |
| format | string | "YYYY-MM-DD" | Display format string. |
| showTime | boolean | false | Enables clock time selector. |
Interactive Examples & Live Previews
2 DemosEvery example includes its own live, interactive preview element alongside the corresponding copyable TypeScript snippet.
Basic Date Picker
Standard single-date picker.
1import React from "react";2import { useForm } from "react-hook-form";3import { DateField } from "antd-dynamic-ui";45export default function BasicDate() {6 const { control } = useForm();7 return (8 <div className="max-w-xs">9 <DateField id="birthDate" control={control} label="Date of Birth" />10 </div>11 );12}
Date and Time Picker with Custom Format
Timestamp picker with hour and minute selection.
1import React from "react";2import { useForm } from "react-hook-form";3import { DateField } from "antd-dynamic-ui";45export default function DateTimePicker() {6 const { control } = useForm();7 return (8 <div className="max-w-sm">9 <DateField10 id="scheduledLaunch"11 control={control}12 label="Scheduled Deployment Window"13 showTime={true}14 format="YYYY-MM-DD HH:mm:ss"15 required={true}16 />17 </div>18 );19}
Frequently Asked Questions & Quick Solutions
Architectural patterns, React 19 compatibility, and integration tips for DateField.
How does DateField integrate with Ant Design 5.x and Next.js 15?▼
DateField is designed as an enhanced, declarative wrapper for Ant Design. It fully supports Next.js 15 App Router when using @ant-design/nextjs-registry, eliminating SSR hydration mismatches and guaranteeing 0ms layout thrashing.
Can I customize validation, themes, and props for DateField?▼
Yes. Every prop is fully typed in TypeScript 5 with comprehensive Intellisense. You can pass custom styling via className or style props, configure global Ant Design themes via ConfigProvider, and extend validation logic seamlessly.