GhostDatePicker reference
Package: @ghostvue/vue. Status: experimental (stability policy).
Headless date-entry and selection root: strict ISO typed entry for a single date or inclusive range, an anchored modal calendar (APG Date Picker Dialog), separate drafts and committed CalendarDate values, native form serialization, validation, and reset.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
defaultOpen | boolean | false | No | Initial uncontrolled open state. |
defaultValue | GhostDatePickerValue | null | No | Initial uncontrolled value and uncontrolled form-reset target. |
defaultVisibleMonth | CalendarDate | — | No | Month shown when the picker opens empty. |
disabled | boolean | false | No | Blocks all interaction and closes the calendar. |
endName | string | — | No | Range end submission name override. |
form | string | — | No | External `<form>` id for submission, validation, and reset. |
format | GhostDatePickerFormat | — | No | Synchronous display formatter; defaults to ISO `YYYY-MM-DD`. |
formatHint | string | "YYYY-MM-DD" | No | Format description linked to every input. |
invalid | boolean | false | No | Consumer-supplied invalid state (`external-invalid`). |
isDateDisabled | ((date: CalendarDate) => boolean) | — | No | Unavailable endpoint dates (focusable, not selectable). |
locale | string | "en-US" | No | Calendar and formatting locale. |
maxValue | CalendarDate | — | No | Inclusive upper bound. |
minValue | CalendarDate | — | No | Inclusive lower bound. |
modelValue | GhostDatePickerValue | — | No | Controlled committed value; `undefined` is uncontrolled, `null` is controlled empty. |
name | string | — | No | Form name: `name` (single) or `name[start]` / `name[end]` (range). |
open | boolean | — | No | Controlled requested open state. |
parse | GhostDatePickerParse | — | No | Synchronous parser; defaults to strict ISO `YYYY-MM-DD`. |
readonly | boolean | false | No | Keeps text focusable and selectable but prevents editing, clearing, and opening. |
required | boolean | false | No | Native required constraint on an empty committed value. |
selectionMode | GhostDatePickerSelectionMode | "single" | No | `'single'` or `'range'`; fixed for the instance (remount with a new `key`). |
startName | string | — | No | Range start submission name override. |
today | CalendarDate | — | No | Explicit current date for SSR-safe "today" styling and focus fallback. |
validateRange | GhostDatePickerValidateRange | — | No | Whole-range business validation returning an error message or `null`. |
validationMessage | ((error: GhostDatePickerError) => string) | — | No | Localizes built-in error messages. |
weekStartsOn | GhostDatePickerWeekday | — | No | Week start override (Sunday = `0`). |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
modelValue | update:modelValue | GhostDatePickerValue | v-model binding for `modelValue`. |
open | update:open | boolean | v-model binding for `open`. |
Slots
| Name | Description |
|---|---|
default | Container content. |
Slot props: default
| Name | Type | Description |
|---|---|---|
clear | () => void | Slot prop `clear`. |
close | () => void | Slot prop `close`. |
errors | GhostDatePickerError[] | Slot prop `errors`. |
open | boolean | Slot prop `open`. |
openCalendar | () => void | Slot prop `openCalendar`. |
pending | boolean | Slot prop `pending`. |
value | GhostDatePickerValue | Slot prop `value`. |
Exposed members
None declared.
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | input | Native text input from GhostDatePickerInput (data-input-part single/start/end). |
data-part | trigger | Native button from GhostDatePickerTrigger that opens the calendar dialog. |
data-part | content | Positioned modal dialog surface from GhostDatePickerContent. |
data-part | close | Built-in Close control inside the content. |
data-part | error-summary | Focusable in-dialog error summary shown after an invalid event while open. |
data-part | status | Polite status line for the range instruction and calendar validation feedback. |
data-part | format-hint | Visually hidden format description linked to every input. |
data-part | error-description | Visually hidden per-input error text linked while errors are shown. |
data-state | open | Trigger data-state while the calendar dialog is open. |
data-state | invalid | Input data-state when it has errors or the consumer marked it invalid. |
data-state | disabled | Input data-state when disabled. |
data-state | readonly | Input data-state when readonly. |
CSS variables
None declared.
Accessibility
Role: dialog. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/.
Required ARIA attributes: aria-haspopup, aria-expanded, aria-controls, aria-modal, aria-describedby, aria-invalid, aria-selected.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
Enter | In an edited input, commits the text and prevents implicit form submission. On the trigger, opens the calendar. On a date, selects it. | Not reviewed |
Space | On the trigger, opens the calendar. On a date, selects it. | Not reviewed |
Escape | In the open dialog, closes it without committing calendar progress and restores focus. In an edited closed input, restores the committed text. | Not reviewed |
Tab | Cycles through the dialog controls; the grid is a single Tab stop. | Not reviewed |
Shift+Tab | Cycles backward through the dialog controls. | Not reviewed |
ArrowLeft | Previous day (next day in RTL). | Not reviewed |
ArrowRight | Next day (previous day in RTL). | Not reviewed |
ArrowUp | Same day previous week. | Not reviewed |
ArrowDown | Same day next week. | Not reviewed |
Home | First day of the week. | Not reviewed |
End | Last day of the week. | Not reviewed |
PageUp | Same day previous month. | Not reviewed |
PageDown | Same day next month. | Not reviewed |
Shift+PageUp | Same day previous year. | Not reviewed |
Shift+PageDown | Same day next year. | Not reviewed |
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Not reviewed | No declared key is mapped to a browser test yet. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
date-picker/basic
Single date with typed ISO entry and an anchored modal calendar.
date-picker/range
Start and end inputs in a named group; two calendar activations commit atomically.