Appica UIUI 1.0.0

Date Picker

An input paired with a calendar for picking a date, a range, or a time.

MMDDYYYY

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.

تاريخ الموعد
MMDDYYYY

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 a role="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 DateField and Calendar.
  • disabled blocks the whole control; disabledDates prevents specific days from being chosen.
  • The error styling is driven by data-invalid; setting aria-invalid flags the field invalid (sets data-invalid) and conveys it to assistive tech. Pass name to submit the value through a hidden input.

© 2026 Appica UI. A free component library, crafted by the Appica team.