Skip to Content
Urban Cowboy
Components

Date Range Picker

Accessible check-in/check-out picker with a popover calendar and night counter.

DateRangePicker owns the calendar popover but leaves the selected range to its caller. It supports month navigation, a minimum date and a live night count. The docs harness keeps the range in local state; it does not load rates from Mews.

*
string
*
string

Props

PropValuesNotes
checkIn / checkOutISO date stringsControlled range
minDateISO date stringEarliest selectable day; defaults to today
onChange(checkIn, checkOut) => voidCalled when a range is chosen

Accessibility

The trigger is a button that opens a labelled calendar dialog. Days are keyboard navigable, and the currently focused day is announced. Selection never closes the popover until the range is complete.

Responsive behaviour

The calendar is a constrained popover that stays inside a narrow wrapper on phones; the docs reserve vertical space so the open state does not overlap following content.

Usage

import { DateRangePicker } from '@/components/forms/date-range-picker';

<DateRangePicker
  checkIn={range.checkIn}
  checkOut={range.checkOut}
  onChange={(checkIn, checkOut) => setRange({ checkIn, checkOut })}
/>

View source