Date Picker
A date field that opens a Calendar in a popover. The readonly combobox field is the trigger; picking a day fills the field and closes the popover.
Import
Section titled “Import”<script> import DatePicker from "@invisible-ui/svelte/DatePicker.svelte";</script><script setup> import { DatePicker } from "@invisible-ui/vue";</script>import { DatePicker } from "@invisible-ui/react";<script type="module"> import "@invisible-ui/elements/define";</script>
<ds-date-picker></ds-date-picker>In Elements, name submits the ISO date with the form:
<form> <ds-date-picker label="Due date" name="due" value="2026-06-15" clearable></ds-date-picker></form>| Prop | Type | Default | Description |
|---|---|---|---|
value | 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" | Intl style for the field display. |
label | string | undefined | undefined | Accessible label for the field. |
placeholder | string | undefined | undefined | Shown when empty. |
disabled | boolean | false | Disable the field. |
clearable | boolean | false | Show a clear button when a date is set. |
events | CalendarEvent[] | [] | Appointment dots, forwarded to the calendar. |
prices | Record<string, string> | {} | Per-day prices, forwarded to the calendar. |
name | string | undefined | undefined | Form field name — the selected ISO date is submitted under it (via a hidden input). |
onValueChange | ((value: string | null) => void) | undefined | undefined | Called when the date changes (or is cleared). |
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | string | null | undefined | Selected date (ISO YYYY-MM-DD); bindable with v-model. |
value | string | null | 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" | |
label | string | undefined | Accessible label for the field. Defaults to the catalog's "Date". |
placeholder | string | undefined | |
disabled | boolean | false | |
clearable | boolean | false | Show a clear button once a date is selected. |
events | CalendarEvent[] | () => [] | Forwarded to the calendar. |
prices | Record<string, string> | () => ({}) | |
name | string | undefined | Form field name; the selected ISO date is submitted under it. |
onValueChange | (value: string | null) => void | undefined |
| Event | Payload |
|---|---|
update:modelValue | value: string | null |
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | null | null | Initial (uncontrolled) or current (controlled) date, 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. |
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 date is selected. |
events | CalendarEvent[] | — | Appointment dots, forwarded to the calendar. |
prices | Record<string, string> | — | Per-day price labels, forwarded to the calendar. |
name | string | — | Form field name; the ISO date is submitted under it. |
onValueChange | (value: string | null) => void | — | Called when the user picks or clears a date. |
| Attribute | Reactive | Description |
|---|---|---|
value | yes | ISO YYYY-MM-DD |
name | yes | |
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 | |
description | yes | |
error | yes |
Reactive attributes re-render the element when they change after the first render.
Properties: value, events, prices (forwarded to the calendar), open (read only).
Emits: change (detail.value, null when cleared).
Accessibility
Section titled “Accessibility”- The field is a readonly
role="combobox"(aria-haspopup,aria-expanded): a click, Enter, Space or ArrowDown opens it. Focus moves to the selected day, or to the day the calendar would focus when none is selected, not to the Today button. - Picking a day, or pressing Escape, closes the calendar and returns focus to the field. The clear button keeps focus on the field when it removes itself.
- See the Calendar for the grid’s keyboard model.
Example
Section titled “Example”<DatePicker value="2026-06-15" label="Event date" clearable />In React, onValueChange reports the picked date, or null when cleared:
<DatePicker label="Event date" value={date} name="date" clearable onValueChange={setDate} />Themeable via --ds-date-picker-* and the calendar’s --ds-calendar-*.