Date Range Picker

Accommodation booking date-range picker. Two-step check-in/checkout flow with 2-month calendar, blocked-date fencing, min/max nights, hover preview, and auto-close on completion. Composes Calendar, Popover, and Button. Exports formatDateRangeSummary — a pure helper that produces "Dec 15 – Dec 20 · 5 nights" strings for use in trigger summaries.

core/date-range-picker

Installation

1 · Add registry to components.json

2 · Install component

Examples

Default

Booking picker with blocked dates, 2-night minimum, and 14-night maximum.

API Reference

PropTypeDescription
valuereq
DateRangeControlled { from?, to? } range.
onChangereq
(value: DateRange) => voidCalled when the range changes.
blockedDates
(Date | BlockedDateRange)[]Dates or date ranges that are unavailable for booking.
minNights
numberMinimum stay in nights.
maxNights
numberMaximum stay in nights.
numberOfMonths
numberNumber of calendar months displayed.
minDate
DateEarliest selectable date.
maxDate
DateLatest selectable date.
checkInPlaceholder
stringTrigger placeholder for check-in.
checkOutPlaceholder
stringTrigger placeholder for checkout.
disabled
booleanDisables the entire control.
open
booleanControlled popover open state.
onOpenChange
(open: boolean) => voidCalled when popover open state changes.