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.

Interested in exploring the event calendar?  Check out these examples →
Get started with this example

Demo

Loading the live demo

Preview in full screen

Code

<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>

Duplicate Session

You have signed in on a different machine. To keep everything in sync, you have been signed out of this session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.

Duplicate Session

We noticed you are logged in on a different machine and have closed your old session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.