DateRangePicker
v1.0.7Updated 27 Aug 2026Two-month range picker in a Popover, with an optional quick-range rail (Today, Yesterday, Last 7/30 days, This month, Last month, This quarter) via `presets` — pass `true` for the built-ins or supply your own presets array. The trigger collapses the range to a compact label, dropping the repeated year when both ends share one. Supports Buddhist Era (พ.ศ.) and Thai locale labels.
Preview
Live · 9 stories▸Why this is recommendeddaterangedaterangepickerpicker+6
DateRangePicker — date range.
- ✓Picking a reporting period or date range
- ✓Filtering a dashboard by last 7 / 30 days
- ✓Selecting a billing period
- ✓Choosing check-in and check-out dates
- ✓Analytics date-range filter with quick presets
- ✓Thai-localised reporting window in Buddhist Era (พ.ศ.)
- ✓Exporting records between two dates
- Start/end range selection across configurable numberOfMonths (default 2)
- Built-in quick-range presets rail (presets={true})
- Custom presets array with click-time range factories
- Smart range label that omits the duplicated year
- fromDate / toDate constraints
- Controlled (range) or uncontrolled (defaultRange)
- Thai Buddhist Era calendar + Thai locale labels
- Does NOT pull in Select
- i18n: calendar month/weekday names and year digits follow the app LocaleProvider (useB69Locale) for non-Thai locales
- ✕Picking one single date (use DatePicker)
- ✕Picking a date plus a time (use DateTimePicker)
- ✕Inline month view (use Calendar directly)
Install
Ask your agent, or call the MCP tool directly. The resolved bundle is written into your project.
Usage
Tick variants in the left menu — each adds a tab with that variant’s real story source, the same code the preview above renders.
Props
rangeSelected range (controlled), from react-day-picker
—onRangeChangeRange selection callback
—defaultRangeInitial value for uncontrolled usage (ignored when `range` is provided)
—presetsQuick-range rail; `true` uses the built-in set (Today … This quarter). Picking one commits the range and closes the popover
—numberOfMonthsMonths shown side by side (default 2)
—placeholderTrigger text when no range is selected (default "Pick a date range")
—fromDateMin selectable date
—toDateMax selectable date
—formatStrdate-fns format string (default "MMM d, yyyy")
—alignPopover alignment
—childrenFooter content rendered under the calendar
—calendarCalendar system; "buddhist" renders พ.ศ. years
—localeLocale for labels and formatting. `locale="th"` now also supplies the Thai BUILT-IN strings (placeholder, era chip พ.ศ./ค.ศ., and for DateRangePicker the whole quick-range rail) — previously the grid localised but the trigger stayed English, which only showed on an EMPTY field. An explicit `labels` (or `placeholder`) still wins, and locale="en" is unchanged. MCP feedback fb_3adc3df4.
—disabledDisables the trigger
—