Date and time
DateRangePicker
Use the clear button to remove the period
2026-03-09 to 2026-03-22 (picked by hand)
No presets: the calendar only
When to use
- In a filter or report, users pick "from/to" dates and often use "7 days", "30 days" and other presets.
- The consumer can store both an expanded
DateRangeand the originalRelativePeriod.
When not to use
- For an arbitrary range layout, use
RangeCalendar. - For a single date, use
DatePicker. - Do not use it to pick only the start of a range: the component emits only a complete range.
Minimal example
<DateRangePicker
value={range}
period={period}
onChange={(nextRange, nextPeriod) => {
setRange(nextRange);
setPeriod(nextPeriod);
}}
onClear={() => {
setRange(null);
setPeriod(null);
}}
/>Public API
value?: DateRange | null, where the bounds are ISO strings;period?: RelativePeriod | nullties the selected preset to the range.onChange(range, period)receivesperiod=nullon a manual pick;onClearis required for the clear button to appear, because clearing must reset both values:valueandperiod.presets,timeZone,minValue,maxValue,defaultFocusedValue,localedefine the allowed ranges and relative presets.minValue,maxValueanddefaultFocusedValueare ISO stringsYYYY-MM-DD, likevalue(minValue="2026-03-09"); there is no need to import@internationalized/date(the package itself comes with the kit). An object is still accepted; an unparsable string is treated as an unset bound.isDateUnavailable(date)marks specific days unavailable — booked dates, holidays: in the calendar they are struck through and cannot be picked. The function receives a calendar object;date.toString()returns the day as aYYYY-MM-DDstring.RangeCalendarandDatePickerhave the same prop. Presets ignore the rule: they are clamped only byminValueandmaxValue, and a preset that covers an unavailable day is picked as is — if that is not allowed, do not leave such a preset inpresets.open/onOpenChangelet you control the popover; otherwise internal state is used.
Accessibility and keyboard
- The clear control is a separate button next to the trigger, not an interactive element inside a button.
- The two-month view appears at a screen width of 640 pixels and up; do not rely on an incomplete selection for a network request.
- Sources:
src/components/date-time/DateRangePicker.tsx,src/components/date-time/DateRangePicker.stories.tsx.
TypeScript types
DateRangePickerProps
Prop
Type