Add Event on Hover
Usage
theme: 'ios' You can turn auto theming on and let it decide based on the platform.
Usage
themeVariant: 'light' You can turn auto dark mode on based on system settings.
Usage
clickToCreate: true,
// click to create is on dragToCreate: true,
// drag to create is on dragToMove: true,
// reordering is on dragToResize: true,
// resizing is on eventDelete: true
// deleting is on Fine-tune drag & drop with these options, which are false by default.
Usage
locale: localeEn Selecting the locale loads the localized settings and the translated UI text.
Add Event on Hover
Hover-based interactions can be simple yet elegant. Using the cell-hover-in and cell-hover-out events, the calendar dynamically displays an "Add event" button when users hover over day cells, providing an intuitive way to create new events with minimal interface clutter.
For customizing the cell content appearance, the calendarDayContent is the perfect candidate, as it holds the basic structure of the day cell.
Demo

Code
View code on GitHub
<script setup>
import {
formatDate,
MbscEventcalendar,
MbscToast,
setOptions
} from '@mobiscroll/vue'
import { ref } from 'vue'
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
})
const myEvents = ref([
{
start: '2026-10-02T12:00',
end: '2026-10-02T16:00',
title: 'Company Strategy Offsite',
color: '#90bcff'
},
{
start: '2026-10-07T09:00',
end: '2026-10-07T17:00',
title: 'R&D Innovation Workshop',
color: '#ffdfaf'
},
{
start: '2026-10-15T10:00',
end: '2026-10-15T15:00',
title: 'Client Feedback Review',
color: '#ffb9ad'
},
{
start: '2026-10-19T09:00',
end: '2026-10-19T19:00',
title: 'Team Building Adventure',
color: '#f3c1ff'
},
{
start: '2026-10-23T11:00',
end: '2026-10-23T15:00',
title: 'Sales Summit & Training',
color: '#b5eff8'
},
{
start: '2026-10-25T10:00',
end: '2026-10-25T15:00',
title: 'Executive Planning Retreat',
color: '#c7ffbb'
},
{
start: '2026-10-29T14:00',
end: '2026-10-29T17:00',
title: 'Marketing Team Conference',
color: '#ffeeb6'
}
])
const hoveredDate = ref(null)
const isToastOpen = ref(false)
const toastMessage = ref('')
const myView = {
calendar: {
labels: 2
}
}
function addEvent() {
const newEvent = {
start: hoveredDate.value,
title: 'New Event'
}
myEvents.value = [...myEvents.value, newEvent]
toastMessage.value = 'Event added on ' + formatDate('YYYY-MM-DD', hoveredDate.value)
isToastOpen.value = true
}
// Mobiscroll resource hover events
function handleCellHoverIn(args) {
hoveredDate.value = args.date
}
function handleCellHoverOut() {
hoveredDate.value = null
}
function handleToastClose() {
isToastOpen.value = false
}
function isHovered(date) {
return hoveredDate.value && hoveredDate.value.getTime() === date.getTime()
}
</script>
<template>
<MbscEventcalendar
cssClass="mds-cell-summary"
:view="myView"
:data="myEvents"
@cell-hover-in="handleCellHoverIn"
@cell-hover-out="handleCellHoverOut"
>
<template #calendarDayContent="args">
<button @click="addEvent" class="mds-cell-summary-btn" v-if="isHovered(args.date)">
Add event
</button>
</template>
</MbscEventcalendar>
<MbscToast :isOpen="isToastOpen" :message="toastMessage" @close="handleToastClose" />
</template>
<style>
.mds-cell-summary .mbsc-calendar-cell {
min-height: 145px;
}
.mds-cell-summary-btn {
position: absolute;
left: 10px;
right: 10px;
bottom: 8px;
z-index: 3;
font-size: 10px;
padding: 8px;
background: transparent;
border-radius: 4px;
border: 1px solid #5584b5;
color: #5584b5;
text-transform: uppercase;
cursor: pointer;
transition: background-color 0.1s ease-out;
}
.mds-cell-summary-btn:hover {
background: #5584b5;
color: white;
box-shadow: 0 2px 8px rgba(85, 132, 181, 0.3);
}
.mds-cell-summary-btn:active {
box-shadow: 0 1px 4px rgba(85, 132, 181, 0.3);
}
</style> <script setup lang="ts">
import {
formatDate,
MbscEventcalendar,
MbscToast,
setOptions
} from '@mobiscroll/vue'
import type { MbscCalendarEvent, MbscCellHoverEvent, MbscEventcalendarView } from '@mobiscroll/vue'
import { ref } from 'vue'
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
})
const myEvents = ref<MbscCalendarEvent[]>([
{
start: '2026-10-02T12:00',
end: '2026-10-02T16:00',
title: 'Company Strategy Offsite',
color: '#90bcff'
},
{
start: '2026-10-07T09:00',
end: '2026-10-07T17:00',
title: 'R&D Innovation Workshop',
color: '#ffdfaf'
},
{
start: '2026-10-15T10:00',
end: '2026-10-15T15:00',
title: 'Client Feedback Review',
color: '#ffb9ad'
},
{
start: '2026-10-19T09:00',
end: '2026-10-19T19:00',
title: 'Team Building Adventure',
color: '#f3c1ff'
},
{
start: '2026-10-23T11:00',
end: '2026-10-23T15:00',
title: 'Sales Summit & Training',
color: '#b5eff8'
},
{
start: '2026-10-25T10:00',
end: '2026-10-25T15:00',
title: 'Executive Planning Retreat',
color: '#c7ffbb'
},
{
start: '2026-10-29T14:00',
end: '2026-10-29T17:00',
title: 'Marketing Team Conference',
color: '#ffeeb6'
}
])
const hoveredDate = ref<Date | undefined>(undefined)
const isToastOpen = ref<boolean>(false)
const toastMessage = ref<string>('')
const myView: MbscEventcalendarView = {
calendar: {
labels: 2
}
}
function addEvent() {
const newEvent: MbscCalendarEvent = {
start: hoveredDate.value!,
title: 'New Event'
}
myEvents.value = [...myEvents.value, newEvent]
toastMessage.value = 'Event added on ' + formatDate('YYYY-MM-DD', hoveredDate.value!)
isToastOpen.value = true
}
// Mobiscroll resource hover events
function handleCellHoverIn(args: MbscCellHoverEvent) {
hoveredDate.value = args.date
}
function handleCellHoverOut() {
hoveredDate.value = undefined
}
function handleToastClose() {
isToastOpen.value = false
}
function isHovered(date: Date) {
return hoveredDate.value && hoveredDate.value.getTime() === date.getTime()
}
</script>
<template>
<MbscEventcalendar
cssClass="mds-cell-summary"
:view="myView"
:data="myEvents"
@cell-hover-in="handleCellHoverIn"
@cell-hover-out="handleCellHoverOut"
>
<template #calendarDayContent="args">
<button @click="addEvent" class="mds-cell-summary-btn" v-if="isHovered(args.date)">
Add event
</button>
</template>
</MbscEventcalendar>
<MbscToast :isOpen="isToastOpen" :message="toastMessage" @close="handleToastClose" />
</template>
<style>
.mds-cell-summary .mbsc-calendar-cell {
min-height: 145px;
}
.mds-cell-summary-btn {
position: absolute;
left: 10px;
right: 10px;
bottom: 8px;
z-index: 3;
font-size: 10px;
padding: 8px;
background: transparent;
border-radius: 4px;
border: 1px solid #5584b5;
color: #5584b5;
text-transform: uppercase;
cursor: pointer;
transition: background-color 0.1s ease-out;
}
.mds-cell-summary-btn:hover {
background: #5584b5;
color: white;
box-shadow: 0 2px 8px rgba(85, 132, 181, 0.3);
}
.mds-cell-summary-btn:active {
box-shadow: 0 1px 4px rgba(85, 132, 181, 0.3);
}
</style>