Registry / web-framework / vue-cal

vue-cal

JSON →
library4.10.2jsnpmunverified

Vue Cal is a lightweight and highly customizable full calendar component for Vue.js applications, currently in its stable version 4.10.2. A key differentiator is its 'no dependency' philosophy, aiming for minimal footprint and maximum flexibility. It offers various views (day, week, month, year), robust event management including adding, editing, dragging, and resizing events, and extensive customization options through slots and CSS. While version 4.x is considered stable and suitable for production, it is no longer actively maintained. Development has shifted to version 5, which is a complete rewrite available under the `@next` tag and housed in a new repository. Users should be aware that future updates and new features will be for v5, and migrating from v4 to v5 will involve breaking changes due to its rebuilt architecture. The project emphasizes separating logic and styles, providing minimal CSS for easy overriding.

npm install vue-cal
INSTALL
IMPORT
SIG · VUE-CAL
V
vue-cal
web-frameworkjavascriptv4.10.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VueCal
import VueCal from 'vue-cal'
const VueCal = require('vue-cal')
Vue Cal is a Vue component designed for ESM imports. CommonJS `require` syntax is not supported for component imports in modern Vue 3 setups.
styles
import 'vue-cal/dist/vuecal.css'
import 'vue-cal/dist/vuecal.scss'
The compiled CSS is required for the calendar's basic styling. Raw SCSS is not exposed for direct import.
Localized Messages
import 'vue-cal/dist/i18n/fr.js'
For internationalization, import the desired language file. This example imports French (`fr.js`). Other languages are available in `dist/i18n`.

This quickstart demonstrates a basic Vue Cal setup in a Vue 3 Composition API component, including event data, a custom theme, and essential styling for proper display.

<template> <div class="calendar-container"> <VueCal class="vuecal--blue-theme" :selected-date="new Date()" :time-step="30" :disable-views="['years', 'year']" :events="events" @ready="onCalendarReady" @event-create="onEventCreate" /> </div> </template> <script setup lang="ts"> import { ref } from 'vue'; import VueCal from 'vue-cal'; import 'vue-cal/dist/vuecal.css'; const events = ref([ { start: new Date(new Date().setHours(10, 0, 0, 0)).toISOString(), end: new Date(new Date().setHours(11, 30, 0, 0)).toISOString(), title: 'Meeting with John', content: 'Discuss project roadmap.', class: 'leisure' }, { start: new Date(new Date().setHours(14, 0, 0, 0)).toISOString(), end: new Date(new Date().setHours(15, 0, 0, 0)).toISOString(), title: 'Team Sync', content: 'Weekly team catch-up.', class: 'work' } ]); function onCalendarReady() { console.log('Vue Cal is ready!'); } function onEventCreate(event: any) { console.log('Event created:', event); // In a real app, you'd typically add the event to your `events` array or backend. } </script> <style> .calendar-container { height: 600px; /* Crucial: Vue Cal needs a defined height */ max-width: 900px; margin: auto; } .vuecal__event.leisure { background-color: #a3c4f3; border: 1px solid #75a7f0; color: #fff; } .vuecal__event.work { background-color: #90ee90; border: 1px solid #6cdd6c; color: #fff; } </style>
Debug
Known issues
breakingVue Cal v4.x is no longer actively maintained. While stable, new features and ongoing support have shifted to Vue Cal v5. Users planning long-term projects or requiring the latest features should consider migrating to v5, which is a complete rewrite and introduces breaking changes.
fix
For new projects, consider `npm i vue-cal@next` and refer to the v5 documentation. For existing v4 projects, plan for a migration path by reviewing the v5 breaking changes if upgrades are desired.
affects: >=4.10.0
gotchaVue Cal requires its parent container or the component itself to have a defined height. If no height is set, the calendar will not render correctly (e.g., appear with zero height).
fix
Ensure the `<vue-cal>` component or its direct parent has a CSS `height` property defined (e.g., `height: 600px;` or `height: 100%;` if the parent has a height).
affects: >=1.0
deprecatedVue Cal's legacy branch for Vue 2 support (`npm i vue-cal@legacy`) has reached End-Of-Life and will not receive further updates or support.
fix
For Vue 2 projects, remain on the `legacy` branch but be aware of no future updates. For new projects or upgrades, use Vue 3 with `vue-cal` v4.x or v5.x.
affects: <4.0
gotchaThe calendar's default CSS is minimal and intentionally not styled with `!important` flags, encouraging users to easily override styles. Direct modification of the component's internal styles can lead to unexpected behavior during updates.
fix
Customize appearance by adding CSS classes to events or the `<vue-cal>` component and targeting those classes in your stylesheet. Refer to the documentation for available CSS variables and thematic classes (e.g., `vuecal--blue-theme`).
affects: >=1.0
gotchaWhen handling events, especially during drag-and-drop operations, the `originalEvent` property in emitted event objects (e.g., `@event-drop`) might return date values as strings instead of `Date` objects, requiring manual parsing.
fix
Always explicitly parse date strings (e.g., `new Date(event.originalEvent.start)`) if you expect `Date` objects from event payloads, particularly for properties like `start` or `end`.
affects: >=4.0
Errors
Common errors & fixes
Failed to resolve module specifier "vue-cal" (or similar 'module not found' error)
The `vue-cal` package is not correctly installed, or the import path is incorrect, or bundler configuration issue.
fix
Ensure `vue-cal` is installed (`npm install vue-cal` or `yarn add vue-cal`). Verify the import statement `import VueCal from 'vue-cal'` is correct and that your bundler supports ESM.
The calendar component renders with zero height or is not visible.
Vue Cal needs a defined height from its parent container or directly on the component to render properly.
fix
Apply a `height` style to the `<vue-cal>` component or its immediate parent element (e.g., `<div style="height: 600px;"><VueCal /></div>` or `<VueCal style="height: 600px;" />`).
Uncaught SyntaxError: Cannot use import statement outside a module (or similar CommonJS errors)
Attempting to use `require('vue-cal')` in a modern Vue 3 project, which primarily uses ES Modules.
fix
Switch to ES module imports: `import VueCal from 'vue-cal';` and ensure your project's build setup (e.g., `package.json` type, bundler config) supports ES Modules.
Type '...' is not assignable to type 'VueCalEvent'. Property '...' is missing in type '...'.
When using TypeScript, event objects or `VueCal` props are not correctly typed according to `vue-cal`'s declarations.
fix
Refer to the `vue-cal` documentation or its TypeScript declaration files (`.d.ts`) for the correct interface for event objects and component props. Ensure all required properties are present and correctly typed.
Upgrade
Version history
4.10.2latest on npm
Audit
Dependencies
vuerequiredPeer dependency for Vue.js framework integration. Vue Cal v4 requires Vue 3.2.0 or higher.
Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources