- Docs
- Components
- Dates
Date range picker
One field for a range: typed in either order, chosen in a range calendar, or a preset in one step.
- Import
- @qeetrix/react/experimental
- Status
- ExperimentalSince 0.0.6
- Renders
<input> + calendarServer-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Import
// Experimental: from the package's experimental entry, until it's stable.
import { DateRangePicker } from "@qeetrix/react/experimental";02
Props
And every native attribute of the element it renders.
| Prop | Type | Default | What it does |
|---|---|---|---|
value · defaultValue | DateRange | null | null | { start, end }, "YYYY-MM-DD". |
onValueChange | (value: DateRange | null) => void | — | The new range; null when cleared or what's typed isn't one. |
presets | (DateRangePreset | DateRangePresetName)[] | — | today, last7Days, last30Days, last90Days, thisMonth, lastMonth, or { label, range }. |
min · max · isDateDisabled | … | — | As DatePicker's; isDateDisabled rules out a range's ends. |
startName · endName | string | — | Hidden inputs that submit the start and the end, "YYYY-MM-DD". |
locale · today · messages | … | — | As DatePicker's; today also anchors the named presets. |
… Input's props | | — | disabled, readOnly, placeholder and the rest. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What it is |
|---|---|---|
input-control | <input> | Both dates: Input's parts throughout. |
icon-button | <button> | The calendar button, named after the field. |
date-range-picker-presets | <div> | The presets beside the calendar; date-range-picker-preset each. |
04
A preset of your own
range can be a function, worked out when the list shows.
const lastQuarter: DateRangePreset = {
label: "Last quarter",
range: () => ({ start: "2026-07-01", end: "2026-09-30" }),
};
<DateRangePicker presets={["last7Days", "last30Days", lastQuarter]} />