Cell Hover Summary Tooltip

This demo demonstrates how to surface detailed cell summaries through tooltips when hovering over schedule cells.

Using cell-hover-in and cell-hover-out events, each tooltip dynamically displays the total number of events, invalid and colors in the hovered cell.

Get started with this example

Demo

Loading the live demo

Preview in full screen

Show a per-cell summary tooltip in the Scheduler — hover over any schedule cell to display event count, invalid slots, and color ranges.

Code

<script setup>
import {
  formatDate,
  MbscEventcalendar,
  MbscPopup,
  setOptions 
} from '@mobiscroll/vue'
import { ref } from 'vue'

setOptions({
  locale:  ,
  theme: ' ',
  themeVariant: ' '
})

const myEvents = ref([
  {
    start: '2026-10-23T08:00',
    end: '2026-10-23T11:00',
    title: 'Task 1'
  },
  {
    start: '2026-10-24T14:00',
    end: '2026-10-24T16:00',
    title: 'Task 2'
  },
  {
    start: '2026-10-25T15:00',
    end: '2026-10-25T17:00',
    title: 'Task 3'
  },
  {
    start: '2026-10-25T10:00',
    end: '2026-10-25T12:00',
    title: 'Task 4'
  },
  {
    start: '2026-10-26T08:00',
    end: '2026-10-26T11:00',
    title: 'Task 5'
  },
  {
    start: '2026-10-26T09:00',
    end: '2026-10-26T12:00',
    title: 'Task 6'
  },
  {
    start: '2026-10-26T10:00',
    end: '2026-10-26T12:00',
    title: 'Task 7'
  },
  {
    start: '2026-10-26T10:00',
    end: '2026-10-26T13:00',
    title: 'Task 8'
  },
  {
    start: '2026-10-26T10:00',
    end: '2026-10-26T14:00',
    title: 'Task 9'
  },
  {
    start: '2026-10-26T16:00',
    end: '2026-10-26T18:00',
    title: 'Task 10'
  },
  {
    start: '2026-10-27T13:00',
    end: '2026-10-27T17:00',
    title: 'Task 11'
  },
  {
    start: '2026-10-27T18:00',
    end: '2026-10-27T20:00',
    title: 'Task 12'
  },
  {
    start: '2026-10-28T08:00',
    end: '2026-10-28T12:00',
    title: 'Task 13'
  },
  {
    start: '2026-10-28T15:00',
    end: '2026-10-28T18:00',
    title: 'Task 14'
  },
  {
    start: '2026-10-29T08:00',
    end: '2026-10-29T11:00',
    title: 'Task 15'
  },
  {
    start: '2026-10-29T15:00',
    end: '2026-10-29T17:00',
    title: 'Task 16'
  },
  {
    start: '2026-10-30T09:00',
    end: '2026-10-30T12:00',
    title: 'Task 17'
  }
])

const myInvalid = ref([
  {
    start: '2026-10-24T12:00',
    end: '2026-10-24T13:00'
  },
  {
    start: '2026-10-25T08:00',
    end: '2026-10-25T10:00'
  },
  {
    start: '2026-10-26T13:00',
    end: '2026-10-26T15:00'
  },
  {
    start: '2026-10-27T15:00',
    end: '2026-10-27T17:00'
  },
  {
    start: '10:00',
    end: '11:00',
    recurring: {
      repeat: 'weekly',
      weekDays: 'TU,TH,SA,SU'
    }
  }
])

const myColors = ref([
  {
    start: '2026-10-25T12:00',
    end: '2026-10-25T14:00',
    cssClass: 'mds-cell-summary-color'
  },
  {
    start: '2026-10-26T10:00',
    end: '2026-10-26T12:00',
    cssClass: 'mds-cell-summary-color'
  },
  {
    start: '2026-10-27T08:00',
    end: '2026-10-27T11:00',
    cssClass: 'mds-cell-summary-color'
  },
  {
    start: '2026-10-28T14:00',
    end: '2026-10-28T17:00',
    cssClass: 'mds-cell-summary-color'
  },
  {
    start: '08:00',
    end: '09:00',
    cssClass: 'mds-cell-summary-color',
    recurring: {
      repeat: 'weekly',
      weekDays: 'MO,FR'
    }
  },
  {
    start: '14:00',
    end: '16:00',
    cssClass: 'mds-cell-summary-color',
    recurring: {
      repeat: 'weekly',
      weekDays: 'TU,TH'
    }
  },
  {
    start: '10:00',
    end: '12:00',
    recurring: {
      repeat: 'weekly',
      weekDays: 'FR'
    },
    cssClass: 'mds-cell-summary-color'
  },
  {
    start: '16:00',
    end: '17:00',
    recurring: {
      repeat: 'weekly',
      weekDays: 'SU,SA'
    },
    cssClass: 'mds-cell-summary-color'
  }
])

const cellDate = ref('')
const cellEventNr = ref(0)
const cellInvalidNr = ref(0)
const cellColorNr = ref(0)
const isTooltipOpen = ref(false)
const tooltipAnchor = ref(null)

const myView = {
  scheduler: {
    type: 'week',
    startTime: '08:00',
    endTime: '18:00',
    timeCellStep: 30
  }
}

// Mobiscroll resource hover events
function handleCellHoverIn(args) {
  const endDate = new Date(args.date)
  endDate.setHours(endDate.getHours() + 1)
  const date = formatDate('DDDD MMM D, YYYY, HA - ', args.date)
  const time = formatDate('HA', endDate)

  cellDate.value = date + time
  cellEventNr.value = args.events ? args.events.length : 0
  cellInvalidNr.value = args.invalids ? args.invalids.length : 0
  cellColorNr.value = args.colors ? args.colors.length : 0

  tooltipAnchor.value = args.target
  isTooltipOpen.value = true
}

function handleCellHoverOut() {
  isTooltipOpen.value = false
}

function handleTooltipClose() {
  isTooltipOpen.value = false
}
</script>

<template>
  <MbscEventcalendar
    cssClass="mds-cell-summary-on-hover"
    :view="myView"
    :data="myEvents"
    :invalid="myInvalid"
    :colors="myColors"
    @cell-hover-in="handleCellHoverIn"
    @cell-hover-out="handleCellHoverOut"
  >
    <template #resource="resource">
      <div class="mbsc-flex">
        <img class="mds-resource-info-avatar" :src="resource.avatar" alt="Avatar" />
        <div class="mds-resource-info-details">
          <div class="mds-resource-info-title">{{ resource.name }}</div>
          <div class="mds-resource-info-profession">{{ resource.profession }}</div>
        </div>
      </div>
    </template>
  </MbscEventcalendar>
  <MbscPopup
    display="anchored"
    :anchor="tooltipAnchor"
    :showOverlay="false"
    :touchUi="false"
    :scrollLock="false"
    :isOpen="isTooltipOpen"
    @close="handleTooltipClose"
  >
    <div class="mds-cell-summary-title">{{ cellDate }}</div>
    <div class="mbsc-flex">
      <div class="mbsc-flex-1-0 mds-cell-summary-item">
        <div class="mbsc-txt-muted">Events</div>
        <div class="mds-cell-summary-content">{{ cellEventNr }}</div>
      </div>
      <div class="mbsc-flex-1-0 mds-cell-summary-item">
        <div class="mbsc-txt-muted">Invalid</div>
        <div class="mds-cell-summary-content">{{ cellInvalidNr }}</div>
      </div>
      <div class="mbsc-flex-1-0 mds-cell-summary-item">
        <div class="mbsc-txt-muted">Colors</div>
        <div class="mds-cell-summary-content">{{ cellColorNr }}</div>
      </div>
    </div>
  </MbscPopup>
</template>

<style>
.mds-cell-summary-on-hover .mbsc-schedule-events.mbsc-ltr {
  right: 20px;
}
.mds-cell-summary-on-hover .mbsc-schedule-events.mbsc-rtl {
  left: 20px;
}
.mds-cell-summary-on-hover .mbsc-schedule-item:hover {
  box-shadow:
    0px 1px 6px 3px rgba(0, 0, 0, 0.2),
    0px 1px 6px 3px rgba(255, 255, 255, 0.2);
}
.mds-cell-summary-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}
.mds-cell-summary-item {
  flex: 1;
}
.mds-cell-summary-content {
  font-weight: 500;
  opacity: 0.8;
  margin-top: 5px;
}
.mds-cell-summary-color {
  background: repeating-linear-gradient(-45deg, #cce9d3, #cce9d3 10px, #c5dfc1 10px, #c5dfc1 20px);
  opacity: 0.5;
}
</style>

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.