Skip to content

Calendar

Select dates from a calendar with keyboard navigation.

Demos

Size
October 2026
SMTWTFS

Usage

vue
<script setup lang="ts">
import { Accordion } from '~/components/ui/accordion'

const items = [
  { value: 'source', label: 'Do I own the source?', content: 'Yes. Copy and adapt the files.' },
]
</script>

<template>
  <Accordion :items="items" />
</template>

Installation

Complete the shared installation. Copy Calendar.vue and index.ts into app/components/ui/calendar/.

API

Variants and defaults

PropValuesDefault
sizexs, sm, md, lg, xlsm

Models

ModelTypeDefaultDescription
v-modelCalendarDateValue | CalendarDateValue[] | CalendarDateRange | undefinedundefinedSelected single date, independent dates, or { start, end } range according to selectionMode.
v-model:placeholderCalendarDateValueselected date or todayMonth used as the start of the visible view.

See Range selection for preview fills and primary-colored endpoints.

Props

PropTypeDefaultDescription
rangeColor"secondary" | "accent""secondary"Preview and committed middle fill; endpoints use primary.
localestring"en-US"Locale used for labels and week calculations.
dir"ltr" | "rtl""ltr"Reading direction and horizontal arrow behavior.
calendarLabelstring"Calendar"Accessible root label prefix.
weekStartsOn"sun" | "mon" | ...locale defaultExplicit first day of week.
weekdayFormat"narrow" | "short" | "long""narrow"Visible weekday label format.
fixedWeeksbooleanfalseAlways renders six weeks per month.
numberOfMonthsnumber1Adjacent month grids to render.
pagedNavigationbooleanfalseNavigates by numberOfMonths instead of one month.
preventDeselectbooleanfalsePrevents removing an already selected date.
selectionMode"single" | "multiple" | "range""single"Selects model shape and interaction behavior.
multiplebooleanfalseDeprecated compatibility alias for selectionMode="multiple".
allowNonContiguousRangesbooleanfalseAllows unavailable or disabled dates inside a range, but not at either endpoint.
maximumDaysnumber—Maximum inclusive length accepted in range mode.
fixedDate"start" | "end"—Keeps one boundary fixed while range interactions update only the opposite boundary.
disabledbooleanfalseDisables navigation and selection.
readOnlybooleanfalseAllows focus/navigation but blocks selection.
initialFocusbooleanfalseFocuses the roving day after mount.
disableDaysOutsideCurrentViewbooleanfalsePrevents selecting outside days.
minValueCalendarDateValue—Earliest selectable date and navigation boundary.
maxValueCalendarDateValue—Latest selectable date and navigation boundary.
isDateDisabled(date) => boolean—Marks dates disabled by application rules.
isDateUnavailable(date) => boolean—Marks dates unavailable and invalid when externally selected.
nextPage(placeholder) => CalendarDateValueadd month(s)Custom next-page calculation.
prevPage(placeholder) => CalendarDateValuesubtract month(s)Custom previous-page calculation.
uiCalendarUi—Classes for generated structural parts.

Slots

SlotPropsDescription
previousdisabledPrevious control content.
headinglabel, monthsCurrent month or range heading.
nextdisabledNext control content.
weekdaydate, labelWeekday heading content.
daydate, label, selected, rangeStart, rangeEnd, inRange, highlighted, today, outside, disabled, unavailable, focusedDay button content and complete selection state.
footervalue, placeholderOptional content after grids.

Events

EventPayloadDescription
update:modelValuevalueFired after accepted selection changes.
update:placeholderdateFired after accepted visible-month changes.
value-change(value, details)Fires before selection changes. details.cancel() prevents update.
placeholder-change(date, details)Fires before page changes. details.cancel() prevents update.

Keyboard

KeyBehavior
ArrowLeft / ArrowRightMove one day, direction-aware in RTL.
ArrowUp / ArrowDownMove one week.
Home / EndMove to start/end of current week.
PageUp / PageDownMove one month.
Shift + PageUp / Shift + PageDownMove one year.
Enter / SpaceSelect or deselect focused date.

Only one day is in the Tab sequence. Arrow navigation can cross month boundaries and updates v-model:placeholder before moving focus.