Date Range Picker
Start and end dates with a range calendar in a popover, typed or picked.
Installation
npx shadcn@latest add @oakoss/date-range-pickerUsage
import { parseDate } from '@internationalized/date';
import { DateRangePicker } from '#/components/ui/inputs/date-range-picker';
<DateRangePicker
defaultValue={{
end: parseDate('2026-03-16'),
start: parseDate('2026-03-14'),
}}
label="Stay"
/>;Two Date Field inputs with a range
Calendar in a popover. The
value is { start, end }, each the same Internationalized Date object as
Date Field's, and null until both are set. Both inputs scroll together
when a long locale doesn't fit.
Examples
Date and time
A CalendarDateTime or ZonedDateTime range with a granularity of
hour, minute or second adds start and end time fields under the
calendar, named by startTimeLabel and endTimeLabel (default "Start
time" and "End time"). They take the picker's hourCycle and
hideTimeZone.
Two months
calendarProps reaches the calendar as on
Date Picker.
visibleMonths: 2 shows a longer range at once; the popover grows to fit,
and the months stack where the screen is too narrow.
Accessibility
React Aria handles:
- Group: both inputs, their decorations and the trigger form a
groupnamed by the label. Each input's segments are named "Start Date" or "End Date" (translated) with the label, and work as in Date Field. Typing past the start's last segment moves into the end. - Trigger and calendar: as on Date Picker. Picking the second day closes the popover and returns focus to the trigger.
- Keyboard: Alt+↓ in a segment opens the calendar, and Escape closes it.
API
DateRangePicker
Extends React Aria's DateRangePicker.
Props
Prop
Type
Also accepts all React Aria DateRangePicker props,
with granularity limited to day for a CalendarDate. A form gets each
end's ISO value from hidden inputs named by startName and endName.
Takes the layout props or children, not both: children replace the layout,
built from the Field parts, DatePickerGroup, DateRangeInput and
DatePickerContent.
Data attributes
| Attribute | Present when |
|---|---|
data-slot | Always: date-range-picker |
data-open | The calendar is open |
data-focus-within | Focus is inside the picker |
data-invalid | The picker is invalid |
data-disabled | The picker is disabled |
DateRangeInput
The start and end inputs and the dash between them, in one scrolling
container, data-slot="date-range-input". Place it in a
DatePickerGroup.
DateRangePickerTime
The start and end time fields the default layout adds to the popover, which render only while the picker's granularity includes a time.