---
title: "Vue Timeline Event Buffer Time Example | Mobiscroll"
component: "Timeline"
framework: "Vue"
library_version: "6.1.5"
url: "https://demo.mobiscroll.com/vue/timeline/event-buffer"
---

# Event Buffer Time - Vue Timeline demo

Visualize buffer time on a Vue Timeline — show travel time, check-in/out, loading/unloading time, or preparation windows around scheduled events. For Vue and Nuxt.

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

## Description

Use the `bufferBefore` and `bufferAfter` to add buffer times that will be rendered before and after the event.

These areas can help you visualize delays or added minutes for tasks. Here are some examples:

- Travel time for meetings, appointments, work orders
- Check in and check out times around flights
- Loading/unloading for bus/truck
- Cleaning, inspection, maintenance work that happen on a recurring basis

**Looking to customize event buffers?** [Check out the templating capabilities →](https://demo.mobiscroll.com/vue/timeline/timeline-custom-event-rendering)

## What this demo shows

- A desktop timeline showing a single day with hours arranged horizontally and resources arranged vertically.
- **Header navigation** The month and year label opens date navigation, while the previous and next arrows and the Today button move between dates and return to the current day.
- **Day view** A fixed date strip below the header shows the selected date in `DD DDD MMM YYYY` format, with the current date highlighted.
- **Time grid** The timeline displays hourly columns from 12 AM to 12 PM.
- **Resources** Multiple resources appear as separate rows on the left side of the timeline.
- **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, the time range below the title, and the title shown in bold.
- **Event buffers** When event buffer display is enabled, buffer time renders before and/or after the event block to show added time around the scheduled event.
- **Buffer control** A control above the timeline lets users turn event buffer display on or off. Buffer display is enabled by default.
- **Event overlapping** Overlapping events are placed side by side so each event remains visible.
- **Event positioning** Events are positioned by assigned resource, date, start time, and end time.
- **Event interaction** Events highlight on hover and expose drag and resize handles for moving events or changing their duration.
- **Event selection** Clicking an event selects and highlights it.
- **Event creation** Users can create events 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

- **Travel time** Showing travel time before or after meetings, appointments, and work orders.
- **Check-in and check-out windows** Visualizing time around flights, bookings, or scheduled appointments.
- **Loading and unloading time** Planning additional time around bus, truck, delivery, or transport work.
- **Preparation and cleanup work** Displaying cleaning, inspection, maintenance, or other recurring work that happens before or after the main scheduled event.
- **Delay visibility** Making added minutes or expected delays visible directly in the timeline.

## Tutorial

### Control the event buffer display globally

- [x] Turn event buffer display ON/OFF

```vue
<script setup>
    // event example
    const myData = [{
        bufferBefore: 30,
        bufferAfter: 120,
        start: '2026-10-22T16:00',
        end: '2026-10-22T20:00',
        title: 'Friends binge marathon',
        resource: 4,
    },{
        bufferAfter: 30,
        start: '2026-10-22T06:00',
        end: '2026-10-22T08:00',
        title: 'Morning routine',
        resource: 1,
    },{
        bufferBefore: 45,
        start: '2026-10-22T09:30',
        end: '2026-10-22T12:00',
        title: 'Product team mtg.',
        resource: 4,
    }];

</script>
<template>
    <MbscEventcalendar
        :view="{timeline: {type: 'day'}}"
        :showEventBuffer="true"
        :data="myData"
    />
</template>
```

## 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
- [`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 { MbscEventcalendar, setOptions } from '@mobiscroll/vue'

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

const myEvents = [
  {
    bufferAfter: 30,
    start: '2026-10-22T06:00',
    end: '2026-10-22T08:00',
    title: 'Morning routine',
    resource: 1
  },
  {
    bufferAfter: 120,
    bufferBefore: 30,
    start: '2026-10-22T16:00',
    end: '2026-10-22T20:00',
    title: 'Friends binge marathon',
    resource: 4
  },
  {
    bufferAfter: 120,
    bufferBefore: 30,
    start: '2026-10-22T13:00',
    end: '2026-10-22T21:00',
    title: 'Mastering CSS class',
    resource: 2
  },
  {
    bufferAfter: 10,
    bufferBefore: 15,
    start: '2026-10-22T08:00',
    end: '2026-10-22T10:00',
    title: 'Product team mtg.',
    resource: 2
  },
  {
    bufferAfter: 20,
    bufferBefore: 30,
    start: '2026-10-22T16:30',
    end: '2026-10-22T19:30',
    title: 'Cinema afternoon',
    resource: 3
  },
  {
    bufferAfter: 10,
    bufferBefore: 10,
    start: '2026-10-22T08:30',
    end: '2026-10-22T10:00',
    title: 'Quick mtg. with Martin',
    resource: 3
  },
  {
    bufferBefore: 45,
    start: '2026-10-22T09:30',
    end: '2026-10-22T12:00',
    title: 'Product team mtg.',
    resource: 4
  }
]

const myResources = [
  {
    id: 1,
    name: 'Resource A',
    color: '#fdf500'
  },
  {
    id: 2,
    name: 'Resource B',
    color: '#ff0101'
  },
  {
    id: 3,
    name: 'Resource C',
    color: '#01adff'
  },
  {
    id: 4,
    name: 'Resource D',
    color: '#239a21'
  },
  {
    id: 5,
    name: 'Resource E',
    color: '#ff4600'
  }
]

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

<template>
  <MbscEventcalendar
    :drag="drag"
    :view="myView"
    :data="myEvents"
    :resources="myResources"
  ></MbscEventcalendar>
</template>
```

### SFC TS

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

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

const myEvents: MbscCalendarEvent[] = [
  {
    bufferAfter: 30,
    start: '2026-10-22T06:00',
    end: '2026-10-22T08:00',
    title: 'Morning routine',
    resource: 1
  },
  {
    bufferAfter: 120,
    bufferBefore: 30,
    start: '2026-10-22T16:00',
    end: '2026-10-22T20:00',
    title: 'Friends binge marathon',
    resource: 4
  },
  {
    bufferAfter: 120,
    bufferBefore: 30,
    start: '2026-10-22T13:00',
    end: '2026-10-22T21:00',
    title: 'Mastering CSS class',
    resource: 2
  },
  {
    bufferAfter: 10,
    bufferBefore: 15,
    start: '2026-10-22T08:00',
    end: '2026-10-22T10:00',
    title: 'Product team mtg.',
    resource: 2
  },
  {
    bufferAfter: 20,
    bufferBefore: 30,
    start: '2026-10-22T16:30',
    end: '2026-10-22T19:30',
    title: 'Cinema afternoon',
    resource: 3
  },
  {
    bufferAfter: 10,
    bufferBefore: 10,
    start: '2026-10-22T08:30',
    end: '2026-10-22T10:00',
    title: 'Quick mtg. with Martin',
    resource: 3
  },
  {
    bufferBefore: 45,
    start: '2026-10-22T09:30',
    end: '2026-10-22T12:00',
    title: 'Product team mtg.',
    resource: 4
  }
]

const myResources: MbscResource[] = [
  {
    id: 1,
    name: 'Resource 1',
    color: '#e20000'
  },
  {
    id: 2,
    name: 'Resource 2',
    color: '#76e083'
  },
  {
    id: 3,
    name: 'Resource 3',
    color: '#4981d6'
  },
  {
    id: 4,
    name: 'Resource 4',
    color: '#f7961e'
  }
]

const myView: MbscEventcalendarView = {
  timeline: { type: 'week' }
}
</script>

<template>
  <MbscEventcalendar
    :drag="drag"
    :view="myView"
    :data="myEvents"
    :resources="myResources"
  ></MbscEventcalendar>
</template>
```

## Implementation notes

- Set `timeline: { type: 'day' }` for a single-day timeline view showing all resources as rows.
- Enable buffer rendering by setting `showEventBuffer: true` on the `Eventcalendar` component. Without this prop the buffer zones are not displayed even if events carry buffer data.
- Add `bufferBefore` and/or `bufferAfter` to individual event objects. Both values are in minutes and are independent - an event can have only before, only after, or both. The buffer zone is rendered as a distinct shaded area adjacent to the event block.
- Define 4 resources with `id`, `name`, and `color`. Use today's date with time offsets (via a relative date helper) for event `start` and `end` so events always appear on the current day.
- Include a variety of buffer combinations to illustrate all cases: `bufferAfter` only (e.g. 30 min after morning routine), `bufferBefore` + `bufferAfter` (e.g. 30 min before and 120 min after a long session), and small symmetric buffers (e.g. 10 min on both sides of a short meeting).

## 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: [Limit Concurrent Events](https://demo.mobiscroll.com/vue/timeline/control-number-of-concurrently-shown-events.md) - Set a maximum number of concurrent events on a Vue Timeline — cap overlapping events per row and show an overflow indicator for hidden events.
- Next: [Custom Range Picker View](https://demo.mobiscroll.com/vue/timeline/custom-range-view.md) - Replace the Vue Timeline's default header navigation with a range picker — let users set any custom date range, synced two-way with the timeline.
