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.
Import
Section titled “Import”<script> import DateRangePicker from "@invisible-ui/svelte/DateRangePicker.svelte";</script><script setup> import { DateRangePicker } from "@invisible-ui/vue";</script>import { DateRangePicker } from "@invisible-ui/react";<script type="module"> import "@invisible-ui/elements/define";</script>
<ds-date-range-picker></ds-date-range-picker>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>| Prop | Type | Default | Description |
|---|---|---|---|
start | string | null | null | |
end | string | null | null | |
min | string | undefined | undefined | |
max | string | undefined | undefined | |
weekStartsOn | WeekStart | undefined | undefined | First day of the week, 0 = Sunday … 6 = Saturday. Defaults to the locale's first day of the week (from locale, else the provider's). |
locale | string | undefined | undefined | |
dateStyle | "full" | "long" | "medium" | "short" | "medium" | |
view | CalendarView | "two-month" | Calendar view inside the popover. |
label | string | undefined | undefined | Accessible label. |
placeholder | string | undefined | undefined | Shown when empty. |
disabled | boolean | false | Disable the field. |
clearable | boolean | false | Show a clear button when a range is set. |
events | CalendarEvent[] | [] | Forwarded to the calendar. |
prices | Record<string, string> | {} | Forwarded to the calendar. |
startName | string | undefined | undefined | Form field names — the start/end ISO dates are submitted under them (via hidden inputs). |
endName | string | undefined | undefined | Form field names — the start/end ISO dates are submitted under them (via hidden inputs). |
onChange | ((start: string | null, end: string | null) => void) | undefined | undefined | Called when the range changes. |
| Prop | Type | Default | Description |
|---|---|---|---|
start | string | null | null | Range start (ISO YYYY-MM-DD), or null. |
end | string | null | null | Range end (ISO YYYY-MM-DD), or null. |
min | string | undefined | |
max | string | undefined | |
weekStartsOn | WeekStart | undefined | First day of the week (0 = Sunday). Defaults to the locale's first day of the week. |
locale | string | undefined | |
dateStyle | DateStyle | "medium" | |
view | CalendarView | "two-month" | Calendar view inside the popover. Defaults to two months side by side. |
label | string | undefined | |
placeholder | string | undefined | |
disabled | boolean | false | |
clearable | boolean | false | |
events | CalendarEvent[] | () => [] | |
prices | Record<string, string> | () => ({}) | |
startName | string | undefined | Form field name for the start date, submitted as an ISO value. |
endName | string | undefined | Form field name for the end date, submitted as an ISO value. |
onChange | (start: string | null, end: string | null) => void | undefined |
| Event | Payload |
|---|---|
update:start | value: string | null |
update:end | value: string | null |
| Prop | Type | Default | Description |
|---|---|---|---|
start | string | null | null | Initial (uncontrolled) or current (controlled) range start, ISO YYYY-MM-DD, or null. |
end | string | null | null | Initial (uncontrolled) or current (controlled) range end, ISO YYYY-MM-DD, or null. |
min | string | — | Earliest selectable date (ISO), inclusive. |
max | string | — | Latest selectable date (ISO), inclusive. |
weekStartsOn | WeekStart | — | First day of the week, 0 = Sunday to 6. |
locale | string | — | BCP-47 locale for the field and the calendar. Defaults to the provider's locale. |
dateStyle | DateStyle | "medium" | Intl date style for the field. |
view | CalendarView | "two-month" | Calendar view inside the popup. Defaults to two months side by side. |
label | string | — | Accessible label for the field. Defaults to the catalog's. |
placeholder | string | — | Placeholder while empty. Defaults to the catalog's. |
disabled | boolean | false | |
clearable | boolean | false | Show a clear button when a range is started. |
events | CalendarEvent[] | — | Appointment dots, forwarded to the calendar. |
prices | Record<string, string> | — | Per-day price labels, forwarded to the calendar. |
startName | string | — | Form field name for the start date, submitted as an ISO value. |
endName | string | — | Form field name for the end date, submitted as an ISO value. |
onChange | (start: string | null, end: string | null) => void | — | Called after each pick and on clear, with a null end while the range is half made. |
| Attribute | Reactive | Description |
|---|---|---|
start | yes | |
end | yes | ISO YYYY-MM-DD |
start-name | yes | |
end-name | yes | |
view | yes | calendar view in the popup, two-month by default |
min | yes | |
max | yes | |
week-starts-on | yes | 0 = Sunday to 6 |
locale | yes | |
date-style | yes | full|long|medium|short |
label | yes | |
placeholder | yes | |
clear-label | yes | |
disabled | yes | |
clearable | yes |
Reactive attributes re-render the element when they change after the first render.
Properties: start, end, events, prices (forwarded to the calendar), open (read only).
Emits: change (detail.start, detail.end; null for a missing end).
Accessibility
Section titled “Accessibility”- 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.
Example
Section titled “Example”<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-*.