DateInput

A locale-aware date field with direct numeric entry and an accessible calendar popover. It shares its surface, focus, validation, and disabled treatment with TextInput.

Props

PropTypeRequiredDefaultDescription
dateDate | nullYes-Controlled date value; null represents an empty field
onDateChange(date: Date | null) => voidYes-Called after valid entry, calendar selection, or clearing the field
labelstringNo-Visible and accessible field label
aria-labelstringNo"Date"Accessible label when no visible label is used
localestringNo"en-GB"Controls segment order, separators, month names, and week layout
minDateNo-Earliest selectable date
maxDateNo-Latest selectable date
namestringNo-Submits an ISO-style YYYY-MM-DD value through a hidden input
disabledbooleanNofalseDisables entry and calendar selection
readOnlybooleanNofalsePrevents changes while retaining the displayed value
requiredbooleanNofalseMarks each date segment as required
aria-invalidbooleanNofalseApplies the shared invalid-field treatment
jssJSSNo-Styles the field wrapper

Provide either label or aria-label so the grouped date segments have an accessible name.

Basic usage

//
01/08/2026
const [date, setDate] = useState<Date | null>(new Date());

<DateInput label="Start date" date={date} onDateChange={setDate} />;

Users can type each numeric segment or open the calendar. Focusing a segment selects its complete value, so typing replaces it naturally. Segment order and calendar labels follow the active locale.

Empty value

//
const [date, setDate] = useState<Date | null>(null);

<DateInput aria-label="Due date" date={date} onDateChange={setDate} />;

Constraints and states

//
//
//

The calendar supports arrow-key navigation, Home, End, Page Up, Page Down, Shift + Page Up, and Shift + Page Down. Escape closes the popover and restores focus to the calendar button.