Skip to content

Calendar

Displays a month-view calendar with holiday markers, range selection, multiple selection, custom cell content, and component-level theme overrides.

Basic Usage

Bind the current selected date through v-model.

April 2026
SunMonTueWedThuFriSat
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
Basic Usage

Holiday Markers

Enable show-holiday to merge the built-in China 2026 holiday data with the custom holidays prop.

April 2026
SunMonTueWedThuFriSat
29
30
31
1
2
3
4
Holiday
5
Holiday
6
Holiday
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Work
27
28
29
30
1
Holiday
2
Holiday
3
Holiday
4
Holiday
5
Holiday
6
7
8
9
Work
Holiday Markers

Custom Date Cell

Use the date-cell slot to render extra business information inside a day cell.

April 2026
SunMonTueWedThuFriSat
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
Custom Date Cell

Range Selection

Set selection-mode="range" and bind v-model:range-value to receive the start and end dates.

April 2026
SunMonTueWedThuFriSat
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9

Please select a start date

Range Selection

Multiple Selection

Set selection-mode="multiple" and bind v-model:multiple-value to manage the selected dates array.

April 2026
SunMonTueWedThuFriSat
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
Multiple Selection

Date Constraints

You can combine min-date, max-date, and disabled-date to control the selectable range.

April 2026
SunMonTueWedThuFriSat
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
Date Constraints

Week Number and Sizes

The calendar supports week numbers and three size presets: small, default, and large.

April 2026
WeekSunMonTueWedThuFriSat
13
29
30
31
1
2
3
4
14
5
6
7
8
9
10
11
15
12
13
14
15
16
17
18
16
19
20
21
22
23
24
25
17
26
27
28
29
30
1
2
18
3
4
5
6
7
8
9
Week Number
April 2026
SunMonTueWedThuFriSat
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
April 2026
SunMonTueWedThuFriSat
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
April 2026
SunMonTueWedThuFriSat
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
Sizes

Readonly

When readonly is enabled, the component keeps its display behavior but no longer reacts to date selection.

April 2026
SunMonTueWedThuFriSat
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
Readonly

Use in Nuxt

After installing @yh-ui/nuxt, you can use YhCalendar directly. The static calendar grid, holiday markers, and slot content render correctly during SSR, while interactive states such as range hovering activate on the client.

April 2026
SunMonTueWedThuFriSat
29
30
31
1
2
3
4
Holiday
5
Holiday
6
Holiday
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Work
27
28
29
30
1
Holiday
2
Holiday
3
Holiday
4
Holiday
5
Holiday
6
7
8
9
Work
Use in Nuxt

API

Props

PropDescriptionTypeDefault
v-model / model-valueBound value in single modeDateundefined
default-valueDefault selected dateDateundefined
modeCalendar mode'month' | 'year''month'
first-day-of-weekFirst day of week, 1 for Monday and 7 for Sundaynumber7
min-dateMinimum selectable dateDateundefined
max-dateMaximum selectable dateDateundefined
readonlyWhether readonlybooleanfalse
disabledWhether disabledbooleanfalse
month-header-formatCustom title formatstringundefined
show-holidayWhether to show holiday and workday markersbooleanfalse
holidaysCustom holiday mapHolidayMap{}
show-week-numberWhether to show week numbersbooleanfalse
fullscreenWhether to fill the parent heightbooleanfalse
selection-modeSelection mode'single' | 'range' | 'multiple''single'
range-valueRange selection value[Date | undefined, Date | undefined]undefined
multiple-valueMultiple selection valueDate[][]
disabled-dateCustom disabled date predicate(date: Date) => booleanundefined
cell-class-nameCustom class name generator for date cells(date: Date) => string | string[] | Record<string, boolean>undefined
show-other-monthsWhether to show dates outside the current monthbooleantrue
highlight-weekendsWhether to highlight weekendsbooleantrue
sizeCalendar size'small' | 'default' | 'large''default'
theme-overridesComponent theme override variablesCalendarThemeVarsundefined

Events

Event NameDescriptionParameters
update:modelValueTriggered when the single value changes(value: Date) => void
update:rangeValueTriggered when range selection completes(value: [Date | undefined, Date | undefined]) => void
update:multipleValueTriggered when the multiple value changes(value: Date[]) => void
changeTriggered when the single value changes(value: Date) => void
panel-changeTriggered when the visible month changes(date: Date, mode: 'month' | 'year') => void
selectTriggered when a date cell is selected(date: Date, cell: CalendarDateCell) => void
range-changeTriggered when range selection completes(value: [Date | undefined, Date | undefined]) => void

Slots

Slot NameDescriptionParameters
headerCustom header title{ date: string }
date-cellCustom date cell content{ data: CalendarCellSlotData }
footerCustom footer area-

CalendarCellSlotData is the runtime slot payload and contains:

FieldTypeDescription
daystringFormatted date string such as 2026-02-14
dateDateNative date object
type'prev-month' | 'current-month' | 'next-month'Month classification
isSelectedbooleanWhether selected
isTodaybooleanWhether today
isDisabledbooleanWhether disabled
isWeekendbooleanWhether weekend
isHolidaybooleanWhether a holiday
holidayNamestring | undefinedHoliday name
isWorkdaybooleanWhether a make-up workday
isInRangeboolean | undefinedWhether inside the current range
isRangeStartboolean | undefinedWhether the range start
isRangeEndboolean | undefinedWhether the range end

Expose

NameDescriptionType
displayDateCurrently displayed panel dateRef<Dayjs>
selectedDateCurrently selected date in single modeRef<Dayjs | undefined>
moveMonthChange the current month(delta: number) => void
goTodayJump to today() => void
selectDateSelect a specific date cell manually(cell: CalendarDateCell) => void

Type Exports

TypeDescription
YhCalendarPropsProps type
YhCalendarEmitsEmits type
YhCalendarSlotsSlots type
YhCalendarExposeExpose type
YhCalendarDateCellDate cell type
YhCalendarHolidayInfoHoliday info type
YhCalendarHolidayMapHoliday map type
YhCalendarRangeValueRange value type
YhCalendarModeMode type

Theme Variables

The component supports themeOverrides and consumes the following CSS variables in styles:

VariableDescriptionDefault
--yh-calendar-primaryPrimary colorvar(--yh-color-primary)
--yh-calendar-primary-lightLight primary backgroundvar(--yh-color-primary-light-9)
--yh-calendar-primary-darkDark primary statevar(--yh-color-primary-dark-2)
--yh-calendar-bgCalendar backgroundvar(--yh-bg-color)
--yh-calendar-textPrimary text colorvar(--yh-text-color-primary)
--yh-calendar-cell-heightDay cell height100px
--yh-calendar-cell-radiusDay cell radiusvar(--yh-radius-lg)
--yh-calendar-head-heightHeader height80px
--yh-calendar-title-sizeTitle font size22px
--yh-calendar-weekday-colorWeekday title colorvar(--yh-text-color-secondary)
--yh-calendar-week-number-colorWeek number colorvar(--yh-text-color-placeholder)
--yh-calendar-holiday-colorHoliday badge colorvar(--yh-color-danger)
--yh-calendar-disabled-bgDisabled backgroundvar(--yh-fill-color-light)
--yh-calendar-disabled-textDisabled text colorvar(--yh-text-color-placeholder)

The exported CalendarThemeVars fields are: headerBgColor, headerTextColor, titleFontSize, dayFontSize, dayTextColor, dayHoverBgColor, daySelectedBgColor, daySelectedTextColor, todayTextColor, and weekendTextColor.

Released under the MIT License.