Skip to content

Date Range Picker

A field that opens a Calendar in range mode: the first click sets the start, the next sets the end (days between are banded), and the popover closes once both are chosen. Defaults to the two-month view.

<script>
import DateRangePicker from "@invisible-ui/svelte/DateRangePicker.svelte";
</script>

In Elements, start-name and end-name submit the two ISO dates with the form:

<form>
<ds-date-range-picker label="Stay" start-name="from" end-name="to"></ds-date-range-picker>
</form>
PropTypeDefaultDescription
startstring | nullnull
endstring | nullnull
minstring | undefinedundefined
maxstring | undefinedundefined
weekStartsOnWeekStart | undefinedundefinedFirst day of the week, 0 = Sunday … 6 = Saturday. Defaults to the locale's first day of the week (from locale, else the provider's).
localestring | undefinedundefined
dateStyle"full" | "long" | "medium" | "short""medium"
viewCalendarView"two-month"Calendar view inside the popover.
labelstring | undefinedundefinedAccessible label.
placeholderstring | undefinedundefinedShown when empty.
disabledbooleanfalseDisable the field.
clearablebooleanfalseShow a clear button when a range is set.
eventsCalendarEvent[][]Forwarded to the calendar.
pricesRecord<string, string>{}Forwarded to the calendar.
startNamestring | undefinedundefinedForm field names — the start/end ISO dates are submitted under them (via hidden inputs).
endNamestring | undefinedundefinedForm field names — the start/end ISO dates are submitted under them (via hidden inputs).
onChange((start: string | null, end: string | null) => void) | undefinedundefinedCalled when the range changes.
  • Readonly role="combobox" field (as in Date Picker); the calendar inside follows the WAI-ARIA date-grid pattern.
  • A click, Enter, Space or ArrowDown opens it, with focus on the start day. Completing the range, or Escape, closes it and returns focus to the field; the clear button keeps focus on the field.
<DateRangePicker start="2026-06-10" end="2026-06-15" label="Stay dates" clearable />

In React, onChange reports both ends after each pick, with a null end while the range is half made:

<DateRangePicker label="Stay dates" start={from} end={to} onChange={(s, e) => setStay([s, e])} />

Themeable via --ds-date-picker-* and the calendar’s --ds-calendar-*.