Skip to content

DateRangePicker

One trigger opens a dialog with two side-by-side Calendars (the given month plus the next). The first pick sets the start and announces"choose end date" through a polite live region; the second pick sets the end. Days between get an in-range treatment, and every pick dispatches an ink:range:change event.

Example

<DateRangePicker
  id="stay"
  label="Hotel stay"
  name="stay"
  month="2026-09"
  locale="en-GB"
/>

The locale is set so day names render in English (formatLong follows the runtime default locale otherwise). Pick the 10th, then the 15th: the stay hidden input holds"2026-09-10", stay-end holds"2026-09-15", and the days between read", in selected range" in their labels. The dialog stays open after every pick so the range can be adjusted; "Clear"resets both hidden inputs and the paint and dispatchesink:range:change with { start: "", end: "" }.

Preselected range

<DateRangePicker
  id="stay-set"
  label="Hotel stay"
  name="stay-set"
  value={{ start: "2026-09-10", end: "2026-09-15" }}
  month="2026-09"
  locale="en-GB"
/>

A value with ISO start/end paints the range server-side — the start (resp. end) day renders pre-selected in the first (resp. second) calendar, with in-range middles labelled. Malformed dates select nothing. Picking a second day earlier than the start restarts the range at the new start instead (the end stays empty); a first calendar month falls back to the start month, then today, and the second always shows the following month.

Props

PropTypeDefaultDescription
idstring-Required. Names Field/panel/message ids (trigger itself carries no id).
labelstring-Visible label; kept in the trigger name and dialog name.
namestringidStart hidden-input form name; carries the ISO start date.
endNamestringname + "-end"End hidden-input form name; carries the ISO end date.
value{ start?: string; end?: string }-Preselected range; each part is a strict ISO date, malformed parts select nothing.
minstring (ISO)-Earliest selectable date in both calendars; earlier days render disabled.
maxstring (ISO)-Latest selectable date in both calendars; later days render disabled.
monthstring ("YYYY-MM")-First calendar's month; the second always shows the following month. Falls back to the start month, then today.
localestring-BCP 47 locale for day and month names; runtime default when omitted.
hintstring-Help text below the trigger.
errorstring-Error message; sets aria-invalid on the trigger.
disabledbooleanfalseNon-interactive; trigger cannot open.
classstring-Style passthrough.

Accessibility