Date Picker

PreviousNext

Calendar-based date selection with popover, range selection, and natural language input

A flexible date picker component built on react-day-picker with popover integration. Supports single date selection, date ranges, time inputs, and natural language parsing.

Basic Usage

A simple date picker with popover and calendar view.

Date Range Selection

Select a range of dates with start and end dates. The calendar displays two months side-by-side for easier range selection.

With Input Field

Integrate date picker with an input field for manual entry. Users can type dates directly or use the calendar button to open the picker.

With Time Selection

Combine date selection with time input for complete datetime picking.

Natural Language Input

Parse natural language date strings like "tomorrow", "next Friday", or "in 2 weeks". Requires the chrono-node package.

Your post will be published on August 23, 2026.

With Validation

Show validation errors for invalid date selections, such as dates in the past.

Disabled Dates

Prevent selection of specific dates, such as weekends, holidays, or dates outside a valid range.

Weekends are disabled

API Reference

Calendar Props

The Calendar component is built on react-day-picker. Key props include:

PropTypeDefaultDescription
mode"single" | "multiple" | "range"-Selection mode for the calendar
selectedDate | DateRange | Date[]-Currently selected date(s)
onSelect(date) => void-Callback when date is selected
disabledDate | Date[] | (date: Date) => boolean-Disable specific dates or date ranges
initialFocusbooleanfalseAuto-focus calendar on mount
numberOfMonthsnumber1Number of months to display
defaultMonthDate-Initially displayed month
captionLayout"dropdown" | "buttons""buttons"Layout for month/year navigation
monthDate-The month to display (controlled)
onMonthChange(month: Date) => void-Callback when month changes

Date Formatting

The examples use date-fns for formatting. Common format strings:

FormatOutputDescription
"PPP"Apr 29, 2023Long format with full month name
"PP"Apr 29, 2023Medium format
"P"04/29/2023Short numeric format
"LLL dd, y"Apr 29, 2023Custom format with abbreviated month
"yyyy-MM-dd"2023-04-29ISO format

See date-fns documentation for all available format options.

Natural Language Parsing

Using chrono-node, you can parse natural language date inputs:

InputParsed Result
"tomorrow"Next day
"next Friday"Upcoming Friday
"in 2 weeks"14 days from now
"3 days ago"3 days in the past
"last Monday"Previous Monday
"Jan 15"January 15 of current year