Date Picker
An input paired with a calendar for picking a date, a range, or a time.
Usage
DatePicker combines a typeable DateField (and optional TimeField) with a Calendar in a Popover — so a value can be typed or picked. It's a custom composition, not a Base UI primitive. The value shape follows mode: a Date for single, a DateRange ({ from, to }) for range, and Date[] for multiple. Leave value/onValueChange off for an uncontrolled picker.
Examples
Single date
mode="single" (the default) with a Date value. Picking a day closes the popover.
Date & time
Add showTime to pair a TimeField with the date so the value carries hours and minutes. Use timeFormat to switch to 12-hour or drop seconds.
Date range
mode="range" selects a span between two dates; the value is a DateRange.
Multiple dates
mode="multiple" collects an array of dates into a read-only summary field. Add clearable to reset, and formatValue to customize the summary text.
Disabled dates
disabledDates takes any react-day-picker Matcher (or an array of them) — block past dates, weekends, specific days, or a predicate.
Variants
Sizes
Disabled & error states
disabled blocks the whole control; aria-invalid drives the data-invalid error styling and flags the field for assistive tech. The picker also inherits disabled and the error state from a surrounding Field, so wrapping it in a Field marked invalid produces the same styling and is the better choice when you're also rendering a validation message.
RTL
Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior — roving focus, popup placement, and the like — follows the same direction.
For setup details and caveats, see the RTL guide.
API reference
Value
Display
Behavior & state
Popover
DatePicker also forwards Calendar configuration props — captionLayout, numberOfMonths, weekStartsOn, showOutsideDays, startMonth/endMonth, and more — to the calendar inside the popover.
Accessibility
- The date/time portions are typeable segmented fields (
role="spinbutton"per segment); the calendar is arole="grid"opened from a labelled trigger button (triggerAriaLabel). - The popover traps focus and restores it to the trigger on close; Escape closes it.
- A value can be entered entirely from the keyboard via the fields, or chosen in the calendar with arrow keys — see
DateFieldandCalendar. disabledblocks the whole control;disabledDatesprevents specific days from being chosen.- The error styling is driven by
data-invalid; settingaria-invalidflags the field invalid (setsdata-invalid) and conveys it to assistive tech. Passnameto submit the value through a hidden input.