Vue Simple Calendar

7.2.2 · active · verified Sun Apr 19

Vue Simple Calendar is a flexible, themeable, and lightweight calendar component designed for Vue 3 applications. It focuses on displaying a traditional month-grid calendar, capable of showing scheduled activities, including multi-day items. The current stable version is 7.2.2. The project appears to have a consistent, active release cadence with several 7.x.x releases in recent times, indicating ongoing maintenance and development. Key differentiators include its small footprint with no external dependencies (like Moment.js or jQuery), a flexbox-based layout, and extensive customization options via Vue slots and CSS. It explicitly avoids complex features like an 'agenda' view, built-in AJAX, or item management interfaces, positioning itself as a display-centric component rather than a date picker or full-featured scheduling system. It also offers date range selection and supports various user events like clicks and drags.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install and integrate Vue Simple Calendar into a Vue 3 TypeScript component, displaying a basic calendar with sample events (including multi-day items) and handling date/item click events. It also includes basic styling imports and custom class usage.

<!-- src/App.vue -->
<template>
  <div id="app">
    <h1>My Event Calendar</h1>
    <div style="width: 80%; margin: 0 auto;">
      <Calendar
        :showDate="currentDate"
        :items="calendarItems"
        :startingDayOfWeek="1"
        @clickDate="onClickDate"
        @clickItem="onClickItem"
      />
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, reactive } from 'vue';
import { Calendar, type ICalendarItem } from 'vue-simple-calendar';
import 'vue-simple-calendar/dist/style.css';
import 'vue-simple-calendar/dist/css/default.css'; // Or your custom theme CSS

const currentDate = ref(new Date());

const calendarItems: ICalendarItem[] = reactive([
  { id: '1', startDate: new Date(2026, 3, 10), endDate: new Date(2026, 3, 12), title: 'Multi-day Event', class: 'custom-event-class' },
  { id: '2', startDate: new Date(2026, 3, 15, 9, 0), endDate: new Date(2026, 3, 15, 10, 30), title: 'Meeting (9:00 AM)' },
  { id: '3', startDate: new Date(2026, 3, 20), title: 'Project Deadline' },
  { id: '4', startDate: new Date(2026, 3, 25), endDate: new Date(2026, 4, 1), title: 'Week-long Project', class: 'long-project' }
]);

function onClickDate(date: Date) {
  console.log('Clicked date:', date.toLocaleDateString());
}

function onClickItem(item: ICalendarItem) {
  console.log('Clicked item:', item.title, 'on', item.startDate.toLocaleDateString());
}
</script>

<style>
/* Basic styling, replace with your custom theme */
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

/* Custom classes for calendar items */
.custom-event-class {
  background-color: #a7f3d0;
  color: #065f46;
  border-radius: 4px;
  padding: 2px 4px;
}

.long-project {
  background-color: #bfdbfe;
  color: #1e40af;
  border-radius: 4px;
  padding: 2px 4px;
  opacity: 0.9;
}
</style>

view raw JSON →