DateRangePicker

Accessible React date range picker for start and end dates on one calendar, with presets, Hijri and Gregorian views, and bounds. Shares the DatePicker core.

DateRangePicker selects a { start, end } range and highlights the days between. It shares the Gregorian/Hijri toggle and calendar core with DatePicker.

When to use

Use DateRangePicker for reporting periods, leave requests, booking windows, or any filter with a start and end. Offer presets such as "Last 30 days" for common ranges. If only one date is needed, use DatePicker.

Both pickers share the Hijri toggle, so the same range works with the Umm al-Qura calendar.

Examples

Basic

Presets (composition recipe)

Hijri calendar (Arabic)

Props

Props declared by DateRangePicker. Native attributes of the underlying element pass through.

PropTypeDefaultDescription
size"md" | "lg"
variant"default" | "filled-lighter" | "filled-darker"
valueDateRangeCurrently selected range (controlled). null clears it.
defaultValueDateRangeInitial range when uncontrolled.
onChange(value: DateRange | null) => voidFires when a complete range is picked, or null when cleared.
minValueDateEarliest pickable date (inclusive).
maxValueDateLatest pickable date (inclusive).
labelreact.ReactNodeVisible label above the trigger.
helperTextreact.ReactNodeHint shown below the trigger. Hidden while an error message is showing.
errorMessagereact.ReactNodeMessage shown below the trigger when error is true.
errorbooleanMarks the field invalid - sets aria-invalid and error styling.
requiredbooleanMarks the field required - adds the asterisk + aria-required.
disabledbooleanDisables the trigger entirely.
readOnlybooleanRead-only: value is shown but not editable (segments + calendar locked).
idstringCaller-supplied id for the field.
classNamestringForwarded to the Group (the trigger row), matching Input/Select.
aria-labelstring
aria-labelledbystring
calendarCalendarSystemCalendar system (controlled). Omit to let the user toggle freely.
defaultCalendarCalendarSystemInitial calendar system when uncontrolled. Defaults to 'gregorian'.
onCalendarChange(calendar: CalendarSystem) => voidFires whenever the calendar system toggles.
showCalendarTogglebooleanShow the Gregorian↔Hijri toggle inside the popover. Defaults to true, but is forced off when calendar is controlled.
calendarLabelsCalendarLabelsOverride the toggle labels. Defaults are locale-aware (English / Arabic).
showSecondaryCalendarbooleanWhen true, each day cell also shows the other calendar's day number as small secondary text. Helps cross-reference Hijri↔Gregorian. Default false.

Accessibility

The range calendar uses the same keyboard model as DatePicker. Arrow keys move, Page Up and Page Down change months, and Enter selects the start and then the end. The selected span is announced.

The field label, helper text, and error follow the TextInput wiring. Presets are ordinary buttons, so they are reachable by keyboard.