Skip to content

DateInputProps

"aria-describedby"?: string;

ids of external error/help text.


className?: string;

defaultValue?: string | null;

Uncontrolled initial value as YYYY-MM-DD. Ignored when value is given.


dir?: "ltr" | "rtl";

Writing direction for the field. Inherited from the document when unset.

Distinct from the locale: locale decides which segments there are and in what order, dir decides which way the box lays them out. A Hebrew page showing a Gregorian date needs one without the other.


disabled?: boolean;

emitOutOfRange?: boolean;

Report a completed date outside min/max through onChange anyway, leaving the field marked invalid rather than refusing the input.

true — the alternative silently discards what the user typed.

id?: string;

Base id; each segment derives ${id}-day, ${id}-month, ${id}-year.


invalid?: boolean;

Sets aria-invalid and data-invalid on the group.


label?: ReactNode;

Accessible name for the whole field.


locale?: string;

BCP 47 tag deciding segment order, separators and month names.

the runtime's locale

max?: string;

Latest allowed date, inclusive, as YYYY-MM-DD.


min?: string;

Earliest allowed date, inclusive, as YYYY-MM-DD.


name?: string;

Emits a hidden input carrying the ISO value, readable by a native <form>.


onBlur?: (event) => void;

Fires when focus leaves the whole field, not when moving between segments.

ParameterType
eventFocusEvent<HTMLElement>

void


onChange?: (value) => void;

Fires when the date becomes complete and valid, and when it stops being so. Never fires mid-entry with a half-typed date.

ParameterType
valuestring | null

void


onFocus?: (event) => void;
ParameterType
eventFocusEvent<HTMLElement>

void


onPartsChange?: (parts) => void;

Fires on every keystroke, including while the date is incomplete.

ParameterType
partsDateParts

void


onWarn?: (warning) => void;

Called in development whenever a prop is rejected or coerced — see DateWarning. When omitted, the same warnings go to console.warn. The entire path is stripped from production builds.

ParameterType
warningDateWarning

void


placeholders?: DatePlaceholders;

Placeholder per segment.

dd / mm / yyyy


readOnly?: boolean;

renderSegment?: (state) => ReactNode;

Custom rendering for one segment.

ParameterType
stateDateSegmentState

ReactNode


required?: boolean;

segmentLabels?: DateSegmentLabels;

Accessible name per segment.

Day / Month / Year


style?: CSSProperties;

value?: string | null;

Controlled value as YYYY-MM-DD, or null for empty.

A string, never a Date: a calendar date is not a point in time, and the moment it becomes one it acquires a timezone that shifts it by a day west of UTC. See the README.