Skip to content

DatePicker API

API reference docs for the Stash DatePicker component. Learn about the props, CSS, and other APIs of this exported module.

Import

ts
import DatePicker from '@leaflink/stash/DatePicker.vue';

Props

NameTypeDefaultDescription
addBottomSpacebooleanfalsePassed to the addBottomSpace prop in the Field component; it adds spacing under the field that is consistent whether or not hint/error text is displayed.
availableDatesArrayundefinedDates or date range objects that are available for selection or navigation. All other dates are disabled.
disabledbooleanfalseWhether the input is disabled
disabledDatesArrayundefinedDates that are disabled from user selection or navigation.
enableTeleportbooleanfalseAdds default modifiers to make the calendar popover teleport; useful in preventing the calendar popover from getting hidden behind its containing element. Although we are not using vue teleport, this name is to future-proof the prop name for when the vCalendar is updated to use teleport internally.
errorTextstring '' Error text to display. Replaces `hintText` (if provided) & adds error styling.
formatstring 'DATE_FORMATS.YYYY_MM_DD_DATE_FNS' Date Format required for date-fns-tz formatInTimeZone()
hideClearButtonbooleanfalseIf true, show clear button
hintTextstring '' Hint text to display below the input
idstring ''
isInputReadonlybooleanfalseDisables text input. Only the calendar popover can update the date value.
labelstring '' Label to render for the datepicker
maxDateDateundefinedPrevents access to portion of the calendar AFTER the specified MAX date. Disables click events for all other dates outside of the min-max ranges.
maxPage{ month: number; year: number; }undefinedLatest page (month, year) that the user can navigate to.
minDateDateundefinedPrevents access to portion of the calendar before the specified MIN date. Disables click events for all other dates outside of the min-max ranges.
minPage{ month: number; year: number; }undefinedEarliest page (month, year) that the user can navigate to.
mode"date" | "dateTime" | "time"dateMode (date, time, datetime)
modelValuestring '' Initial value to pass to the datepicker
namestring '' `name` property for datepicker's input
placeholderstringundefined`placeholder' property for datepicker input
popoverOptionsDatePickerPopoverOptions-Popover configuration; v-calendar uses Popover internally.
timeZonestring 'UTC' `timezone` TZ DB time zone property

Slots

NameDescription
hint

Events

NameDescription
update:model-value
blur