DatePicker

Date pickers let people select a date, or a range of dates.

Usage

DatePicker lets people select a date, or a range of dates, from a month grid. mode="range" discriminates value/defaultValue/onChange (React), bind:value/defaultValue/onChange (Svelte), or the inputs bound to value/defaultValue/valueChange (Angular) to a [start, end] DateRange instead of a single Date.

Controlled selection

Use value with onChange in React, bind:value in Svelte, or [(value)] in Angular. A controlled DatePicker emits a request but does not change until its owner supplies the new value.

S
M
T
W
T
F
S

Selected: 9/20/2026

Selecting a range

Set mode="range". The first click starts a new range; the second completes it in chronological order regardless of click order, and a third click after completion starts a new range.

S
M
T
W
T
F
S

Start: 6/10/2024
End: 6/20/2024

Uncontrolled usage

defaultValue captures the initial value once; the component then owns its own selection and only notifies changes.

S
M
T
W
T
F
S

Constraining selectable dates

minDate/maxDate and shouldDisableDate are compared at day granularity, so a boundary carrying a time-of-day (for example new Date()) never disables its own day. Blocked days stay visible and focusable, but cannot be selected.

S
M
T
W
T
F
S
S
M
T
W
T
F
S

Localization

locale formats the month label and weekday headers; weekStartDay shifts which day begins each row.

S
M
T
W
T
F
S
L
M
M
J
V
S
D

Accessibility

The day grid uses the composite grid/row/gridcell pattern with one roving tabIndex per visible month. Arrow keys move focus by day or week, Home/End jump to the visible week’s boundaries, and PageUp/PageDown change month (Shift for year). The selected day’s gridcell carries aria-selected; its focusable day button carries aria-current="date" when it is today. Unavailable days stay focusable with aria-disabled instead of the native disabled attribute, so keyboard users can still traverse past them.

DatePicker does not render its own text input or popup positioning; combine it with TextField/IconButton and your own overlay to build a popup picker.