DocumentationNuxt Charts v3

Calendar

A versatile and customizable calendar component for Nuxt UI, supporting date and range selection, time picking, and i18n.

Use Calendar to select dates, date ranges, and optional times. It requires Vue, Tailwind CSS, and dayjs, inherits Nuxt UI colors when available, and emits selections without showing notifications or changing the global locale.

Example

Here's an example of the Calendar in action:

October 2026
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Learn how to use the Nuxt Charts CLI to get premium components.

Props

PropTypeDefaultDescription
selectionMode'single' | 'range' | 'multiple''single'The selection mode for dates.
initialDateDateundefinedThe initially selected date (for single and multiple modes).
initialStartDateDateundefinedThe initially selected start date (for range mode).
initialEndDateDateundefinedThe initially selected end date (for range mode).
showTimePickerbooleanfalseIf true, the time picker is displayed.
timeSlotsstring[]['09:00', ...]An array of time slots to display in the time picker.
initialTimestringundefinedThe initially selected time.
dateFormatstring'dddd, MMMM D, YYYY'The format for displaying selected dates.
timeFormatstring'HH:mm'The format for displaying selected times.
weekDayLabels[string, string, string, string, string, string, string]Locale weekday namesAn array of labels for the days of the week.
orientation'vertical' | 'horizontal''horizontal'The orientation of the calendar and time picker.
visibleMonthsnumber1The number of months to display at once.
localestring'en'The locale for dayjs (e.g., 'en', 'es', 'fr').
disabledDatesDate[]undefinedAn array of dates to disable.
minDateDateundefinedThe minimum selectable date.
maxDateDateundefinedThe maximum selectable date.
classNamesobject{}An object with classes to customize the calendar's appearance.

Events

EventPayloadDescription
date-selectDate | Date[]Emitted when a date is selected. The payload is a Date object in single mode and an array of Date objects in multiple mode.
range-select{ start: Date | null, end: Date | null }Emitted when a date range is selected in range mode.
time-selectstringEmitted when a time is selected from the time picker.
month-changeDayjsEmitted when the displayed month changes. The payload is a dayjs object.
year-changenumberEmitted when the displayed year changes.

Styling

You can customize the calendar's appearance by passing a classNames object with the following keys:

  • container: The main container of the calendar.
  • header: The header section with the month and navigation buttons.
  • weekdays: The container for the weekday labels.
  • day: A single day in the calendar grid.
  • today: A class for the current day.
  • selected: A class for selected dates.
  • disabled: A class for disabled dates.
  • inRange: A class for dates within a selected range.

Example:

<template>
  <Calendar :class-names="customClasses" />
</template>

<script setup lang="ts">
const customClasses = {
  header: 'bg-elevated',
  selected: '!bg-success !text-inverted',
}
</script>

Internationalization (i18n)

To use the calendar in different locales, import the desired locale from dayjs and pass the locale prop. For example, for Spanish:

<script setup>
import 'dayjs/locale/es'
</script>

<template>
  <Calendar locale="es" />
</template>
<template>
  <Calendar />
</template>

Controlled Selection

Use v-model to update a selection from the parent. The value is a Date for single mode, Date[] for multiple mode, or { start: Date | null, end: Date | null } for range mode. Passing null clears the selection. The initialDate, initialStartDate, and initialEndDate props remain available for uncontrolled usage.

<script setup lang="ts">
import { ref } from 'vue'
const range = ref<{ start: Date | null, end: Date | null }>({ start: null, end: null })
const time = ref<string>()
</script>

<template>
  <Calendar v-model="range" v-model:time="time" selection-mode="range" show-time-picker :week-starts-on="1" />
</template>

weekStartsOn accepts 0 (Sunday) through 6 (Saturday) and defaults to 0. Custom weekDayLabels are supplied in Sunday-to-Saturday order and rotated to match the week start. Import any required dayjs locale in the parent project.

The header slot receives monthsToShow, previousMonth, and nextMonth. The previous and next slots customize navigation content. The day slot receives a Date and a selected boolean.

Install the date dependency with npm install dayjs. Date buttons use dateFormat for accessible labels, and time slots use timeFormat for display.