Resource Background Styling

Easily highlight resources or columns by adding a simple background color or craft a more specific look with the cssClass property of the resources data.

The output could be a custom background to individual resources or columns and it can be used for multiple purposes. For example:

  • Different styling for certain columns, like thicker border acting as separator.
  • Resource selection, where the selected resource has a different background.
  • Setting different backgrounds for the resource titles and grid columns.
Interested in highlighting date ranges only?  Explore this example →
Get started with this example

Demo

Loading the live demo

Preview in full screen

Color-code resources in a Scheduler with custom backgrounds and CSS classes — style headers, all-day areas, and grid columns per resource.

Code

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

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

const myResources = ref([
  {
    id: 1,
    name: 'Resource - Full column background with "background" property',
    color: '#e20000',
    background: 'rgba(71, 251, 34, 0.37)'
  },
  {
    id: 2,
    name: 'Resource B  - Thicker borders - with "cssClass" property',
    color: '#1dab2f',
    cssClass: 'md-col-tick-border'
  },
  {
    id: 3,
    name: 'Resource C',
    color: '#4981d6'
  },
  {
    id: 4,
    name: 'Resource D - Resource only background with "cssClass" property',
    color: '#e25dd2',
    cssClass: 'md-resource-only-bg'
  },
  {
    id: 5,
    name: 'Resource E - Different backgrounds with "cssClass" property',
    color: '#4981d6',
    cssClass: 'md-diff-custom-bg'
  },
  {
    id: 6,
    name: 'Resource F',
    color: '#d6d145'
  },
  {
    id: 7,
    name: 'Resource G - Grid only background with "cssClass" property',
    color: '#34c8e0',
    cssClass: 'md-colum-only-bg'
  }
])

const myEvents = ref([
  {
    start: '2026-10-22T08:00',
    end: '2026-10-22T10:00',
    title: 'Event 1',
    resource: 1
  },
  {
    start: '2026-10-22T09:00',
    end: '2026-10-22T15:00',
    title: 'Event 2',
    resource: 3
  },
  {
    start: '2026-10-22T14:00',
    end: '2026-10-22T21:00',
    title: 'Event 3',
    resource: 4
  },
  {
    start: '2026-10-22T07:00',
    end: '2026-10-22T12:00',
    title: 'Event 4',
    resource: 5
  },
  {
    start: '2026-10-22T11:00',
    end: '2026-10-22T20:00',
    title: 'Event 6',
    resource: 6
  },
  {
    start: '2026-10-22T04:00',
    end: '2026-10-22T10:00',
    title: 'Event 7',
    resource: 2
  },
  {
    start: '2026-10-22T15:00',
    end: '2026-10-22T18:00',
    title: 'Event 8',
    resource: 7
  },
  {
    start: '2026-10-22T12:00',
    end: '2026-10-22T14:00',
    title: 'Event 9',
    resource: 4
  },
  {
    start: '2026-10-22T10:00',
    end: '2026-10-22T12:00',
    title: 'Event 10',
    resource: 2
  }
])

const myView = {
  scheduler: { type: 'day' }
}
</script>

<template>
  <MbscEventcalendar :clickToCreate="" :dragToCreate="" :dragToMove="" :dragToResize="" :eventDelete="" :view="myView" :data="myEvents" :resources="myResources" groupBy="date" />
</template>

<style>
.md-diff-custom-bg.mbsc-schedule-header-item,
.md-diff-custom-bg.mbsc-schedule-resource {
  opacity: 0.8;
  background-image: repeating-linear-gradient(
      45deg,
      #ffd6d6 25%,
      transparent 25%,
      transparent 75%,
      #ffd6d6 75%,
      #ffd6d6
    ),
    repeating-linear-gradient(45deg, #ffd6d6 25%, #ffefef 25%, #ffefef 75%, #ffd6d6 75%, #ffd6d6);
  background-position:
    0 0,
    10px 10px;
  background-size: 20px 20px;
}
.md-diff-custom-bg.mbsc-schedule-column {
  background-image: radial-gradient(#ae8a8a 20%, transparent 20%);
  background-color: #f9f9f9;
  background-position:
    0 0,
    10px 10px;
  background-size: 20px 20px;
}

.md-diff-custom-bg.mbsc-schedule-all-day-item {
  background: repeating-linear-gradient(-45deg, #fcfffc, #fcfffc 10px, #eefbec 10px, #eefbec 20px);
}

.md-col-tick-border.mbsc-schedule-all-day-item,
.md-col-tick-border.mbsc-schedule-column,
.md-col-tick-border.mbsc-schedule-resource.mbsc-schedule-col-width {
  border-left: 4px solid #ccc;
  border-right: 3px solid #ccc;
}

.md-col-tick-border.mbsc-schedule-all-day-item::after {
  border-right: 4px solid #ccc;
}

.md-colum-only-bg.mbsc-schedule-column {
  background: rgba(0, 128, 128, 0.8);
}

.md-resource-only-bg.mbsc-schedule-resource {
  background: rgba(255, 166, 0, 0.7);
}
</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.