DatePicker

A date field you can type into, with a Calendar in a popover. Typed text is read in the locale's numeric order (09/30/2026 for en-US, 30.09.2026 for tr-TR) or as ISO 2026-09-30.

StableSource

Type MM/DD/YYYY or pick from the calendar.

value: null

Import

import { DatePicker } from "@meridui/react";

Examples

Range

mode="range" renders a start and an end field. The calendar closes once both days are picked.

Min, max and disabled days

Typed dates outside the limits are rejected and the field reverts to the last valid value.

Weekdays only, from today.

Sizes and states

In a form

With name, a hidden input submits yyyy-mm-dd. A range submits two values under name[]. toISODate(date) gives the same string.

API reference

Renders a div; other div attributes and the ref go on it. aria-label / aria-labelledby name the text field. Inside a Field the (first) field gets the id, description, error, required and disabled.

PropTypeDefaultDescription
mode"single" | "range""single"Pick one day or a start and end day.
value / defaultValueDate | null | DateRange–Controlled or initial selection.
onValueChange(value) => void–Called with the new day (or range); null when the field is cleared.
localestring"en-US"Calendar names, week start and the typed numeric format.
min / maxDate–Earliest and latest selectable day.
isDateDisabled(date: Date) => boolean–Marks individual days unavailable.
weekStartsOn0 – 6–First calendar column. Defaults to the locale's week start.
open / onOpenChangeboolean / (open) => void–Controlled open state of the calendar.
placeholderstringlocale pattern, e.g. MM/DD/YYYYPlaceholder of the text field(s).
calendarLabelstring"Choose date"Accessible name of the calendar button.
dialogLabelstringcalendarLabelAccessible name of the calendar dialog.
previousMonthLabel / nextMonthLabelstring"Previous month" / "Next month"Calendar navigation button names.
startLabel / endLabelstring"Start date" / "End date"Range only: names of the two fields.
size"sm" | "md" | "lg""md"Height of the field.
invalid / disabled / requiredboolean–States; inside a Field they come from it.
namestring–Hidden input with yyyy-mm-dd; a range submits name[] twice.
iconReactNode–Icon inside the calendar button.
inputIdstring–id of the (first) text field.

Styling

ClassElement
.mrd-date-pickerRoot (data-size, data-mode, data-invalid, data-disabled)
.mrd-date-picker__fieldBordered field
.mrd-date-picker__input, .mrd-date-picker__separatorText field(s) and the range dash
.mrd-date-picker__triggerCalendar button (data-state)
.mrd-date-picker__contentPopover holding the calendar

Accessibility

The text field is the primary input; the calendar button (aria-haspopup="dialog") opens a non-modal dialog with focus on the selected day. Picking a day or pressing Escape closes it and returns focus to the button. See Calendar for keys inside the grid.

KeyAction
AltArrowDownIn the text field: open the calendar.
EnterIn the text field: read the typed date. In the calendar: pick the focused day.
EscapeClose the calendar and return focus to the button.
  • Calendar — the inline grid.
  • Field — label, hint and error around a control.