Ship-It Designv0.0.20

GitHub

DateRangePicker

A button trigger that opens a popover with one or two adjacent calendars in range mode. The anchor of every booking flow — start → end.

Two-month (desktop default)#

Loading…

Single month (mobile)#

Loading…

Props#

Props for DateRangePicker
PropTypeDefaultDescription
valueDateRange | undefined
defaultValueDateRange | undefined
onValueChange((range: DateRange) => void) | undefined
monthsenum2Number of months shown side-by-side. Default `2` for desktop, `1` for mobile.
placeholderstring | undefinedPickup → ReturnPlaceholder shown when no range is set.
format((d: Date) => string) | undefined(d: Date) => d.toLocaleDateString()Custom formatter. Default uses each date's `toLocaleDateString()`.
widthstring | number | undefined320Pixel width of the trigger.
disabledboolean | undefined
isDateDisabled((date: Date) => boolean) | undefinedOptional disable predicate forwarded to each Calendar.
aria-labelstring | undefined
idstring | undefined

Selection model#

  • First click sets from.
  • Second click sets to. If the user clicks an earlier date than from, the two are swapped so the range always reads forward.
  • A third click starts a new range with the third date as from.
  • While from is set but to is not, hover-preview shades the in-progress range using the accent-dim token so the user sees the span before committing.

Composition#

The underlying Calendar accepts mode="range" directly — wrap with a Popover yourself if you need a custom trigger.