---
title: "Vue Timeline Resource Header Customization Example | Mobiscroll"
component: "Timeline"
framework: "Vue"
library_version: "6.2.0"
url: "https://demo.mobiscroll.com/vue/timeline/resource-header-template"
---

# Resource Header Customization - Vue Timeline demo

Add custom filters, labels, or contextual UI to Vue Timeline resource headers — useful for room booking and resource scheduling views. For Vue and Nuxt.

- [Live demo](https://demo.mobiscroll.com/vue/timeline/resource-header-template)
- [View SFC JS code on GitHub](https://github.com/acidb/mobiscroll-demos-vue/tree/main/src/demos/eventcalendar/timeline/resource-header-template)
- [View SFC TS code on GitHub](https://github.com/acidb/mobiscroll-demos-vue-ts/tree/main/src/demos/eventcalendar/timeline/resource-header-template)
- This demo in other frameworks: [JavaScript](https://demo.mobiscroll.com/timeline/resource-header-template.md), [jQuery](https://demo.mobiscroll.com/jquery/timeline/resource-header-template.md), [Angular](https://demo.mobiscroll.com/angular/timeline/resource-header-template.md), [React](https://demo.mobiscroll.com/react/timeline/resource-header-template.md)

## Description

The empty space above the resource list can be customized through the [`resourceHeader`](https://mobiscroll.com/docs/vue/eventcalendar/api#slot-resourceHeader) template. This a perfect place for filtering or headers in case of a resource grid and everything that helps the users in the context of the timeline.

## What this demo shows

- A desktop weekly timeline with days arranged horizontally and resources listed as rows on the left.
- **Header navigation** The month and year label opens date navigation, the previous and next arrows move between weeks, and the Today button returns to the current date.
- **Week view** The strip below the header shows the selected work week from Monday to Friday, with the current date highlighted.
- **Time grid** The timeline displays hourly columns from 12 AM to 12 PM.
- **Resources** Meeting rooms are shown as separate timeline rows, with events scheduled against each room.
- **Resource columns** Each room is displayed with its seating capacity in a dedicated column.
- **Resource alignment** The custom resource columns stay aligned with the timeline during horizontal and vertical scrolling.
- **Current time** A vertical blue line with a time label marks the current time.
- **Hover behavior** Hovering over the time grid shows a time indicator that follows the cursor in 15-minute increments.
- **Event cards** Events appear as colored cards with a left color stripe, a bold title, and the exact start and end time.
- **Date positioning** Events are positioned by assigned resource, date, and time range.
- **Event interaction** Events highlight on hover and show drag and resize handles for repositioning or changing duration.
- **Event selection** Clicking an event selects and highlights it.
- **Event creation** New events can be created by double-clicking the timeline or by clicking and dragging across a time range.
- **Scrolling** The timeline supports horizontal and vertical scrolling for navigating through time and resources.

## Best for

- **Room booking** Helps users compare meeting room attributes without opening additional dialogs or detail views.
- **Resource scheduling** Useful for applications where resource metadata affects scheduling decisions, such as facility management, equipment scheduling, healthcare, education, and workforce planning.
- **Resource grids** Provides a pattern for showing custom resource columns next to a timeline while keeping the columns aligned with scheduled events.

## API used in this demo

- [`theme`](https://mobiscroll.com/docs/vue/eventcalendar/api#opt-theme) - option
- [`themeVariant`](https://mobiscroll.com/docs/vue/eventcalendar/api#opt-themeVariant) - option
- [`clickToCreate`](https://mobiscroll.com/docs/vue/eventcalendar/api#opt-clickToCreate) - option
- [`dragToCreate`](https://mobiscroll.com/docs/vue/eventcalendar/api#opt-dragToCreate) - option
- [`dragToMove`](https://mobiscroll.com/docs/vue/eventcalendar/api#opt-dragToMove) - option
- [`dragToResize`](https://mobiscroll.com/docs/vue/eventcalendar/api#opt-dragToResize) - option
- [`eventDelete`](https://mobiscroll.com/docs/vue/eventcalendar/api#opt-eventDelete) - option
- [`view`](https://mobiscroll.com/docs/vue/eventcalendar/api#opt-view) - option
- [`data`](https://mobiscroll.com/docs/vue/eventcalendar/api#opt-data) - option
- [`resources`](https://mobiscroll.com/docs/vue/eventcalendar/api#opt-resources) - option

## Code

### SFC JS

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

setOptions({
  theme: 'ios',
  themeVariant: 'light'
})

const myEvents = ref([])
const myResources = ref([
  {
    id: 1,
    name: 'Flatiron Room',
    seats: 90,
    color: '#fdf500'
  },
  {
    id: 2,
    name: 'The Capital City',
    seats: 250,
    color: '#ff0101'
  },
  {
    id: 3,
    name: 'Heroes Square',
    seats: 400,
    color: '#01adff'
  },
  {
    id: 4,
    name: 'Thunderdome',
    seats: 1200,
    color: '#239a21'
  },
  {
    id: 5,
    name: 'King’s Landing',
    seats: 550,
    color: '#ff4600'
  },
  {
    id: 6,
    name: 'Gathering Field',
    seats: 900,
    color: '#8f1ed6'
  }
])

const myView = {
  timeline: {
    type: 'week',
    startDay: 1,
    endDay: 5
  }
}

onMounted(() => {
  getJson(
    'https://trial.mobiscroll.com/daily-weekly-events/',
    (events) => {
      myEvents.value = events
    },
    'jsonp'
  )
})
</script>

<template>
  <MbscEventcalendar :clickToCreate="true" :dragToCreate="true" :dragToMove="true" :dragToResize="true" :eventDelete="true"
    className="md-resource-header-template"
    :view="myView"
    :data="myEvents"
    :resources="myResources"
  >
    <template #resource="resource">
      <div class="md-resource-header-template-cont">
        <div class="md-resource-header-template-name">{{ resource.name }}</div>
        <div class="md-resource-header-template-seats">{{ resource.seats + ' seats' }}</div>
      </div>
    </template>
    <template #resourceHeader>
      <div class="md-resource-header-template-title">
        <div class="md-resource-header-template-name">Room</div>
        <div class="md-resource-header-template-seats">Capacity</div>
      </div>
    </template>
  </MbscEventcalendar>
</template>

<style>
.md-resource-header-template .mbsc-timeline-resource-col {
  width: 230px;
}

.md-resource-header-template .mbsc-timeline-resource-header,
.md-resource-header-template .mbsc-timeline-resource-title {
  padding: 0;
}

.md-resource-header-template .mbsc-timeline-resource-title {
  height: 100%;
}

.md-resource-header-template-cont {
  line-height: 50px;
  height: 100%;
}

.md-resource-header-template-name {
  height: 100%;
  display: inline-block;
  padding: 0 5px;
}

.md-resource-header-template-seats {
  border-left: 1px solid #ccc;
  width: 90px;
  height: 100%;
  float: right;
  padding: 0 5px;
}

.md-resource-header-template-title {
  font-weight: 600;
  line-height: 56px;
}
</style>
```

### SFC TS

```vue
<script setup lang="ts">
import { getJson, MbscEventcalendar, setOptions } from '@mobiscroll/vue'
import type { MbscCalendarEvent, MbscEventcalendarView, MbscResource } from '@mobiscroll/vue'
import { onMounted, ref } from 'vue'

setOptions({
  theme: 'ios',
  themeVariant: 'light'
})

const myEvents = ref<MbscCalendarEvent[]>([])
const myResources = ref<MbscResource[]>([
  {
    id: 1,
    name: 'Flatiron Room',
    seats: 90,
    color: '#fdf500'
  },
  {
    id: 2,
    name: 'The Capital City',
    seats: 250,
    color: '#ff0101'
  },
  {
    id: 3,
    name: 'Heroes Square',
    seats: 400,
    color: '#01adff'
  },
  {
    id: 4,
    name: 'Thunderdome',
    seats: 1200,
    color: '#239a21'
  },
  {
    id: 5,
    name: 'King’s Landing',
    seats: 550,
    color: '#ff4600'
  },
  {
    id: 6,
    name: 'Gathering Field',
    seats: 900,
    color: '#8f1ed6'
  }
])

const myView: MbscEventcalendarView = {
  timeline: {
    type: 'week',
    startDay: 1,
    endDay: 5
  }
}

onMounted(() => {
  getJson(
    'https://trial.mobiscroll.com/daily-weekly-events/',
    (events: MbscCalendarEvent[]) => {
      myEvents.value = events
    },
    'jsonp'
  )
})
</script>

<template>
  <MbscEventcalendar :clickToCreate="true" :dragToCreate="true" :dragToMove="true" :dragToResize="true" :eventDelete="true"
    className="md-resource-header-template"
    :view="myView"
    :data="myEvents"
    :resources="myResources"
  >
    <template #resource="resource">
      <div class="md-resource-header-template-cont">
        <div class="md-resource-header-template-name">{{ resource.name }}</div>
        <div class="md-resource-header-template-seats">{{ resource.seats + ' seats' }}</div>
      </div>
    </template>
    <template #resourceHeader>
      <div class="md-resource-header-template-title">
        <div class="md-resource-header-template-name">Room</div>
        <div class="md-resource-header-template-seats">Capacity</div>
      </div>
    </template>
  </MbscEventcalendar>
</template>

<style>
.md-resource-header-template .mbsc-timeline-resource-col {
  width: 230px;
}

.md-resource-header-template .mbsc-timeline-resource-header,
.md-resource-header-template .mbsc-timeline-resource-title {
  padding: 0;
}

.md-resource-header-template .mbsc-timeline-resource-title {
  height: 100%;
}

.md-resource-header-template-cont {
  line-height: 50px;
  height: 100%;
}

.md-resource-header-template-name {
  height: 100%;
  display: inline-block;
  padding: 0 5px;
}

.md-resource-header-template-seats {
  border-left: 1px solid #ccc;
  width: 90px;
  height: 100%;
  float: right;
  padding: 0 5px;
}

.md-resource-header-template-title {
  font-weight: 600;
  line-height: 56px;
}
</style>
```

## Implementation notes

- Use `timeline: { type: 'week', startDay: 1, endDay: 5 }` - a Mon-Fri week view.
- Define 6 venue resources (Flatiron Room, The Capital City, Heroes Square, Thunderdome, King's Landing, Gathering Field), each with `id`, `name`, `color`, and a custom `seats` property (capacity count). Load events from `https://trial.mobiscroll.com/daily-weekly-events/` via `getJson` (Angular: `HttpClient.jsonp`).
- Use `renderResource` (Angular: `resourceTemplate`, Vue: `#resource`) to render each resource row label. The renderer receives the resource object - render `resource.name` and `resource.seats + ' seats'` as two separate elements side by side.
- Use `renderResourceHeader` (Angular: `resourceHeaderTemplate`, Vue: `#resourceHeader`) to replace the empty top-left corner above the resource sidebar. This renderer receives no arguments - it renders static column labels (`'Room'` and `'Capacity'`) that visually align with the two elements rendered by `renderResource` below.

## Run it in your project

1. If not signed up yet, or don't own a license, you can [start a free trial](https://mobiscroll.com/starttrial).

2. Clone the repository:

   ```
   git clone https://github.com/acidb/mobiscroll-demos-vue.git
   ```

3. If not installed yet, install the Mobiscroll CLI from NPM:

   ```
   npm install -g @mobiscroll/cli
   ```

4. Config Mobiscroll - open a terminal window in the root directory and run:

   ```
   mobiscroll config vue
   ```

5. Install dependencies - open a terminal window in the root directory and run:

   ```
   npm install
   ```

6. Run the project:

   ```
   npm run dev
   ```

On a trial, add `--trial` to the config command: `mobiscroll config vue --trial`.

Running a demo locally requires a Mobiscroll trial or a license; setup is per framework at https://mobiscroll.com/docs/vue/getting-started/installation

## Related demos

- Previous: [Employee Shift Slots](https://demo.mobiscroll.com/vue/timeline/shift-template.md) - Build a Vue Timeline with custom shift slot headers — replace hourly intervals with Morning and Afternoon, each with its own time range and color.
- Next: [Custom Event Tooltip](https://demo.mobiscroll.com/vue/timeline/custom-event-tooltip.md) - Show native, Mobiscroll popup, or third-party tooltips on the Vue timeline events — control hover behavior with event callbacks.
