Skip to content

Calendar

@astryxdesign/core v0.7.1 · Calendar

Calendar Props ​

NameTypeDefaultDescription
modelValueDate | nullnullThe selected date.
mode'single' | 'range''single'Select one day, or a start and end.
range{ start: Date | null, end: Date | null } | nullnullRange value. Bind with v-model:range.
numberOfMonths1 | 21How many months to show side by side.
focusDateDate—Month to show first.
minDate—Earliest selectable date.
maxDate—Latest selectable date.
isDateDisabled(date: Date) => boolean—Return true to disable a date.
dateConstraintsArray<(date: Date) => boolean>—A day is disabled when any function returns false. This applies together with the earliest date, the latest date, and the disable predicate.
minRangeSpannumber1Shortest range length, counting both ends. Above 1, clicking the start again cancels the selection.
maxRangeSpannumber—Longest range length, counting both ends. It applies only after a start is picked.
hasOutsideDaysbooleantrueShow days from the neighboring months. Those days cannot be selected.
hasWeekNumbersbooleanfalseShow the week number at the start of each row.
hasVariableRowCountbooleanfalseShrink the grid to the weeks the month needs. Otherwise the grid stays six rows tall.
weekStartsOn0-6 | 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'0First day of the week. 0 is Sunday.
handleRefRef | (handle) => void—Receives a handle. navigateTo moves the month to that day and focuses it.
labelstringCalendar / 日历Accessible name for the calendar. English by default; Chinese when zh-CN is provided.
disabledbooleanfalseDisables the whole calendar.

Calendar events ​

NamePayloadDescription
update:modelValuevalue: Date | nullEmitted when the selected date changes.
update:rangevalue: { start: Date | null, end: Date | null }Emitted when the range changes.
changevalue: Date | nullEmitted when the selected date changes.
update:focusDatevalue: DateEmitted when the visible month changes. The value is the first day of that month.

Calendar slots ​

NamePropsDescription
header—Custom month header.
day{ date, isSelected, isDisabled, isToday, isInMonth }Custom day cell.