DateField
The browser’s own date input (type="date"). The value is a YYYY-MM-DD string.
Import
Copy code
import { DateField } from '@k8ordo/ui';Usage
Copy code
<DateField aria-label="Date" defaultValue="2026-09-25" name="eventDate" />Min and max
The browser checks the range. A date outside it reports rangeUnderflow or rangeOverflow.
Copy code
<DateField
aria-label="Date"
defaultValue="2026-09-25"
max="2026-12-31"
min="2026-09-01"
/>Disabled
Copy code
<DateField aria-label="Date" defaultValue="2026-09-25" disabled />Invalid
Copy code
<DateField aria-label="Date" invalid />With @k8ordo/form
Spread the input derived from z.iso.date() as it is. There is no need to take type out.
Copy code
// schema.ts
export const eventSchema = z.object({ eventDate: z.iso.date() });
// event-form.tsx
const eventDate = form.field('eventDate');
<FormControl
errorText={eventDate.error}
invalid={eventDate.invalid}
label="Date"
required={eventDate.required}
renderInput={(props) => <DateField {...props} {...eventDate.input} />}
/>Props
invalid?- Type:
boolean - Default:
false ref?- Type:
Ref<HTMLInputElement> - Default: -
| Prop | Type | Default |
|---|---|---|
invalid? | boolean | false |
ref? | Ref<HTMLInputElement> | - |
Inherited attributes (except the ones set internally): InputHTMLAttributes<HTMLInputElement>