Form
Date Range Picker
A start/end date field with quick presets. Two months side by side on wide screens, one under 640px; the range previews as you hover or move with the keyboard.
Usage
- Use for report periods, filters and bookings.
- Offer presets for the common ranges; most people never open the grid.
- Don’t use two DatePickers for a period; the range preview prevents end-before-start mistakes.
Installation
Install the package (React 19):
terminal
terminal
terminal
Import the styles once, in your app entry or root layout:
/src/main.tsx
Use it anywhere inside your app's <Theme> (see Installation):
/src/DateRangePickerExample.tsx
Examples
In a Field, with min
Check-in from today.
Invalid and disabled
Choose a period of 90 days or less.
Dark theme
API Reference
DateRangePicker
The ref goes to the trigger <button>.
| Prop | Type | Default |
|---|---|---|
value / defaultValue | DateRange | { from: null, to: null } |
onValueChange | (value: DateRange) => void | |
placeholder | string | "Pick a date range" |
min / max | Date | |
presets | { label: string; range: DateRange }[] | |
size | "sm""md""lg" | "md" |
clearable | boolean | true |
locale | string | "en-US" |
weekStartsOn | 01 | 0 |
today | Date | new Date() |
open | boolean | |
defaultOpen | boolean | |
onOpenChange | (open: boolean) => void | |
invalid | boolean | false |
disabled | boolean | false |
required | boolean | false |
name | string | |
id | string | |
className | string | |
style | CSSProperties | |
aria-label | string | |
aria-describedby | string |
Accessibility
- The trigger is a button with
aria-haspopup="dialog"; the popover is a dialog named "Choose dates". - Each month is a date grid with the Calendar keys; moving past the last visible month scrolls the months.
- First
Enter/ click sets the start, the second sets the end (in either order) and closes; a polite status line says "Pick an end date" in between. - Presets are toggle buttons (
aria-pressedfor the active one).
© 2026 Motion. Internal documentation.