Event creation modal
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
touchUi: true
// touch interaction is enabled Use touch interaction on mobile or pointer interaction on desktop.
Usage
locale: localeEn Selecting the locale loads the localized settings and the translated UI text.
Event creation modal
Use the popup to show a modal with an add/edit form for event creation and/or update. The popup can be easily set up to be shown right in the middle of the screen, top, bottom or anchored to the newly added event. Check out the different display modes and play around with the different configurations.
You have full control over what is shown within the popup. Use Mobiscroll form elements or any components that you are already using throughout your application.
Demo
Code
View code on GitHub
<script setup>
import {
MbscButton,
MbscDatepicker,
MbscEventcalendar,
MbscInput,
MbscPage,
MbscPopup,
MbscSegmented,
MbscSegmentedGroup,
MbscSwitch,
MbscTextarea,
MbscToast,
setOptions
} from '@mobiscroll/vue'
import { ref } from 'vue'
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
})
const myEvents = ref([
{
id: 1,
start: '2026-10-08T13:00',
end: '2026-10-08T13:45',
title: "Lunch @ Butcher's",
description: '',
allDay: false,
bufferBefore: 15,
free: true,
color: '#009788'
},
{
id: 2,
start: '2026-10-31T15:00',
end: '2026-10-31T16:00',
title: 'Conference',
description: '',
allDay: false,
bufferBefore: 30,
free: false,
color: '#ff9900'
},
{
id: 3,
start: '2026-10-30T18:00',
end: '2026-10-30T22:00',
title: 'Site Visit',
description: '',
allDay: false,
bufferBefore: 60,
free: true,
color: '#3f51b5'
},
{
id: 4,
start: '2026-11-01T10:30',
end: '2026-11-01T11:30',
title: 'Stakeholder mtg.',
description: '',
allDay: false,
free: false,
color: '#f44437'
}
])
const mySelectedDate = ref(new Date())
const isPopupOpen = ref(false)
const popupEventAllDay = ref(false)
const datePickerControls = ['calendar']
const datetimePickerControls = ['calendar', 'time']
const popupEventTitle = ref('')
const popupEventDescription = ref('')
const popupEventDates = ref([new Date(), new Date()])
const popupEventStatus = ref('free')
const toastMessage = ref('Event added')
const isToastOpen = ref(false)
const startInput = ref(null)
const endInput = ref(null)
function openPopup() {
popupEventTitle.value = 'New Event'
isPopupOpen.value = true
}
</script>
<template>
<MbscPage>
<div class="mbsc-form-group">
<div class="mbsc-button-group-block">
<MbscButton @click="openPopup">Add event</MbscButton>
</div>
</div>
<MbscPopup
:width="400"
:contentPadding="false"
headerText="Add new event"
display="center"
:isOpen="isPopupOpen"
:buttons="[
'cancel',
{
text: 'Add',
keyCode: 'enter',
handler: function () {
const newEvent = {
title: popupEventTitle,
description: popupEventDescription,
allDay: popupEventAllDay,
status: popupEventStatus,
start: popupEventDates[0],
end: popupEventDates[1]
}
myEvents = [...myEvents, newEvent]
mySelectedDate = popupEventDates[0]
isPopupOpen = false
isToastOpen = true
},
cssClass: 'mbsc-popup-button-primary'
}
]"
@close="isPopupOpen = false"
>
<div class="mbsc-form-group">
<MbscInput label="Title" v-model="popupEventTitle" />
<MbscTextarea label="Description" v-model="popupEventDescription" />
</div>
<div class="mbsc-form-group">
<MbscSwitch label="All-day" v-model="popupEventAllDay" />
<MbscInput ref="startInput" label="Starts" />
<MbscInput ref="endInput" label="Ends" />
<MbscDatepicker
v-model="popupEventDates"
select="range"
:touchUi="true"
display="anchored"
:controls="popupEventAllDay ? datePickerControls : datetimePickerControls"
:startInput="startInput"
:endInput="endInput"
:showRangeLabels="false"
/>
<MbscSegmentedGroup v-model="popupEventStatus">
<MbscSegmented value="busy">Show as busy</MbscSegmented>
<MbscSegmented value="free">Show as free</MbscSegmented>
</MbscSegmentedGroup>
<MbscToast :message="toastMessage" :isOpen="isToastOpen" @close="isToastOpen = false" />
</div>
</MbscPopup>
<MbscEventcalendar :selectedDate="mySelectedDate" :data="myEvents"> </MbscEventcalendar>
</MbscPage>
</template>
<script setup lang="ts">
import {
MbscButton,
MbscDatepicker,
MbscEventcalendar,
MbscInput,
MbscPage,
MbscPopup,
MbscSegmented,
MbscSegmentedGroup,
MbscSwitch,
MbscTextarea,
MbscToast,
setOptions
} from '@mobiscroll/vue'
import type { MbscCalendarEvent } from '@mobiscroll/vue'
import { ref } from 'vue'
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
})
const myEvents = ref<MbscCalendarEvent[]>([
{
id: 1,
start: '2026-10-08T13:00',
end: '2026-10-08T13:45',
title: "Lunch @ Butcher's",
description: '',
allDay: false,
bufferBefore: 15,
free: true,
color: '#009788'
},
{
id: 2,
start: '2026-10-31T15:00',
end: '2026-10-31T16:00',
title: 'Conference',
description: '',
allDay: false,
bufferBefore: 30,
free: false,
color: '#ff9900'
},
{
id: 3,
start: '2026-10-30T18:00',
end: '2026-10-30T22:00',
title: 'Site Visit',
description: '',
allDay: false,
bufferBefore: 60,
free: true,
color: '#3f51b5'
},
{
id: 4,
start: '2026-11-01T10:30',
end: '2026-11-01T11:30',
title: 'Stakeholder mtg.',
description: '',
allDay: false,
free: false,
color: '#f44437'
}
])
const mySelectedDate = ref<Date>(new Date())
const isPopupOpen = ref<boolean>(false)
const popupEventAllDay = ref<boolean>(false)
const datePickerControls: any = ['calendar']
const datetimePickerControls: any = ['calendar', 'time']
const popupEventTitle = ref<string>('')
const popupEventDescription = ref<string>('')
const popupEventDates = ref<Date[]>([new Date(), new Date()])
const popupEventStatus = ref<'free' | 'busy'>('free')
const toastMessage = ref<string>('Event added')
const isToastOpen = ref<boolean>(false)
const startInput = ref<any>(null)
const endInput = ref<any>(null)
function openPopup() {
popupEventTitle.value = 'New Event'
isPopupOpen.value = true
}
</script>
<template>
<MbscPage>
<div class="mbsc-form-group">
<div class="mbsc-button-group-block">
<MbscButton @click="openPopup">Add event</MbscButton>
</div>
</div>
<MbscPopup
:width="400"
:contentPadding="false"
headerText="Add new event"
display="center"
:isOpen="isPopupOpen"
:buttons="[
'cancel',
{
text: 'Add',
keyCode: 'enter',
handler: function () {
const newEvent = {
title: popupEventTitle,
description: popupEventDescription,
allDay: popupEventAllDay,
status: popupEventStatus,
start: popupEventDates[0],
end: popupEventDates[1]
}
myEvents = [...myEvents, newEvent]
mySelectedDate = popupEventDates[0]
isPopupOpen = false
isToastOpen = true
},
cssClass: 'mbsc-popup-button-primary'
}
]"
@close="isPopupOpen = false"
>
<div class="mbsc-form-group">
<MbscInput label="Title" v-model="popupEventTitle" />
<MbscTextarea label="Description" v-model="popupEventDescription" />
</div>
<div class="mbsc-form-group">
<MbscSwitch label="All-day" v-model="popupEventAllDay" />
<MbscInput ref="startInput" label="Starts" />
<MbscInput ref="endInput" label="Ends" />
<MbscDatepicker
v-model="popupEventDates"
select="range"
:touchUi="true"
display="anchored"
:controls="popupEventAllDay ? datePickerControls : datetimePickerControls"
:startInput="startInput"
:endInput="endInput"
:showRangeLabels="false"
/>
<MbscSegmentedGroup v-model="popupEventStatus">
<MbscSegmented value="busy">Show as busy</MbscSegmented>
<MbscSegmented value="free">Show as free</MbscSegmented>
</MbscSegmentedGroup>
<MbscToast :message="toastMessage" :isOpen="isToastOpen" @close="isToastOpen = false" />
</div>
</MbscPopup>
<MbscEventcalendar :selectedDate="mySelectedDate" :data="myEvents"> </MbscEventcalendar>
</MbscPage>
</template>