DatePicker

An accessible date-picker with a calendar popover.

Category: inputs · WCAG 2.2-AA · date, calendar, picker, input, form

Sizes

States

Props

PropTypeDefaultDescription
idstringBase id for the input and its popover/aria wiring; auto-generated when omitted.
valuestringControlled ISO date value (YYYY-MM-DD)
defaultValuestringUncontrolled default value
onValueChange(value: string | undefined) => voidCalled with the selected ISO date string (or undefined when cleared)
minstringMinimum ISO date
maxstringMaximum ISO date
clearablebooleanfalseShows a clear button
typeablebooleantrueWhen true, the field accepts a typed date as well as one picked from the calendar.
disabledDate(date: Date) => booleanRejects individual dates the bounds allow — holidays, weekends, taken slots.
formatIntl.DateTimeFormatOptionsFormatting options for the displayed date. Defaults to the locale's numeric form.
showTodaybooleanfalseWhen true, the calendar offers a button that jumps to the current month.
namestringSubmitted with a surrounding form — a hidden input carrying the ISO value.
requiredbooleanMarks the control as required for assistive technology.
openbooleanControlled open state of the calendar popup.
onOpenChange(open: boolean) => voidCalled when the popup opens or closes.
labelstringVisible field label rendered above the input; it also names the control.
hintstringHint text
errorstringError message
size'sm' | 'md' | 'lg'mdField size
disabledbooleanfalseDisables the picker
labelsDatePickerLabelsi18n label overrides
aria-labelledbystringWired automatically by a wrapping `Field` — its label id, forwarded to the focusable control so the Field's label names it.
aria-describedbystringWired automatically by a wrapping `Field` — the ids of its hint/error text, forwarded to the focusable control so the supporting text is announced.
aria-invalidbooleanWired automatically by a wrapping `Field` when it is in an error state.
ariaLabelstringInvisible accessible name, for when a visible element outside this component already labels it and `label` would render that text a second time. ⚠ `label` on this component is **visible**; `IconButton.label`/`Sparkline.label` are invisible names, which is the prior that costs adopters a duplicated label. The raw DOM `aria-label` still wins over this.

Design tokens

When to use

When not to use

How to build an accessible DatePicker in React →

Examples

Basic

Uncontrolled date picker

<DatePicker label="Date" />

Clearable

With clear button

<DatePicker label="Date" clearable />

With constraints

Date range constraint

<DatePicker min="2024-01-01" max="2024-12-31" />

Related components

← Back to docs