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)
onChange(value: string | undefined) => voidDeprecated: use onValueChange (same ISO string | undefined)
minstringMinimum ISO date
maxstringMaximum ISO date
clearablebooleanfalseShows a clear button
labelstringField label
hintstringHint text
errorstringError message
size'sm' | 'md' | 'lg'mdField size
disabledbooleanfalseDisables the picker
labelsDatePickerLabelsi18n label overrides

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