npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

calcom-vue

v2.1.0

Published

Vue 3 & Nuxt plugin for seamless Cal.com modal and embed integration

Readme

calcom-vue

A lightweight, type-safe Vue 3 and Nuxt 3 plugin for seamless Cal.com scheduling popup modals and inline embeds.


Features

  • Vue 3 & Nuxt 3 Ready: Full SSR-safe client initialization out of the box with getSSRProps().
  • Multiple Integration Styles: Declarative v-cal directive, pre-built <CalButton /> for modals, <CalEmbed /> (or <Cal />) for inline calendar layouts, and programmatic useCal() composable.
  • Inline & Modal Embeds: Full support for both Cal.com popup modals and inline calendar containers.
  • Modern Theming: Supports cssVarsPerTheme for custom light/dark brand colors, theme, and custom layouts.
  • Self-Hosting Support: Configurable origin and embedJsUrl for self-hosted Cal instances.
  • Lazy Loaded & Idempotent: Injects Cal.com's loader script only when needed on the client, preserving namespace isolation and avoiding settings overwrite.
  • Fully Typed: Written in TypeScript with complete type definitions (.d.ts).

Installation

# npm
npm install calcom-vue

# pnpm
pnpm add calcom-vue

# yarn
yarn add calcom-vue

# bun
bun add calcom-vue

Setup

1. Nuxt 3

Create a universal plugin at plugins/cal.ts (do not use the .client.ts suffix so that the v-cal directive is registered during SSR, avoiding getSSRProps errors):

// plugins/cal.ts
import { defineNuxtPlugin } from '#app';
import { createCal } from 'calcom-vue';

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.use(
    createCal({
      origin: 'https://app.cal.com',
      namespace: 'my-team',
      theme: 'auto',
      layout: 'month_view',
      cssVarsPerTheme: {
        light: { 'cal-brand': '#2563eb' },
        dark: { 'cal-brand': '#3b82f6' }
      }
    })
  );
});

2. Vue 3 (Vite / SPA)

Register the plugin in your entry file (main.ts or main.js):

// main.ts
import { createApp } from 'vue';
import App from './App.vue';
import { createCal } from 'calcom-vue';

const app = createApp(App);

app.use(
  createCal({
    theme: 'auto',
    layout: 'month_view',
    forwardQueryParams: true
  })
);

app.mount('#app');

Usage

1. Inline Embed (<CalEmbed /> / <Cal />)

Render the interactive Cal.com scheduler directly inside your page layout:

<script setup lang="ts">
import { CalEmbed } from 'calcom-vue';
</script>

<template>
  <div class="calendar-wrapper">
    <!-- Using <CalEmbed /> or alias <Cal /> -->
    <CalEmbed
      calLink="john-doe/30min"
      :config="{ layout: 'month_view', theme: 'light' }"
      style="width: 100%; height: 650px; overflow: scroll;"
    />
  </div>
</template>

<CalEmbed /> Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | calLink | string | Required | The Cal.com link (e.g., username/event-slug). | | namespace | string | undefined | Optional Cal namespace for multi-calendar pages. | | config | Record<string, any> | {} | Optional embed config (prefill inputs, layout, theme). |


2. Directive (v-cal)

Add v-cal to any native button, link, or clickable element to trigger the booking popup modal.

<script setup lang="ts">
import { ref } from 'vue';

const activeLink = ref('john-doe/30min');
</script>

<template>
  <!-- Simple string (reactive) -->
  <button v-cal="activeLink">
    Book a Call
  </button>

  <!-- Object with custom configuration -->
  <button 
    v-cal="{
      link: 'john-doe/discovery',
      namespace: 'sales',
      config: {
        theme: 'dark',
        layout: 'week_view',
        name: 'Jane Doe',
        email: '[email protected]'
      }
    }"
  >
    Book Discovery Call
  </button>

  <!-- Using Cal.com data attributes fallback -->
  <button v-cal data-cal-link="john-doe/quick-chat" data-cal-namespace="support">
    Quick Chat
  </button>
</template>

3. Modal Button (<CalButton />)

A pre-built component for opening booking popups:

<script setup lang="ts">
import { CalButton } from 'calcom-vue';
</script>

<template>
  <!-- Basic usage -->
  <CalButton calLink="john-doe/30min">
    Schedule 30-min Call
  </CalButton>

  <!-- Custom tag and configuration -->
  <CalButton 
    tag="a"
    calLink="john-doe/strategy" 
    namespace="custom-namespace"
    :config="{
      theme: 'light',
      notes: 'Strategy Session'
    }"
    class="custom-btn"
  >
    Book Strategy Session
  </CalButton>
</template>

4. Programmatic Composable (useCal)

Use useCal for custom workflows, modals, inline mounting, asset preloading, and event tracking:

<script setup lang="ts">
import { onMounted } from 'vue';
import { useCal } from 'calcom-vue';

// Optionally specify default namespace: useCal('my-namespace')
const { openModal, preload, on, off, setUI, getApi } = useCal();

function openBooking() {
  openModal({
    calLink: 'john-doe/30min',
    config: {
      theme: 'dark',
      layout: 'month_view',
      name: 'Client Name',
      email: '[email protected]'
    }
  });
}

function handleHover() {
  preload({ calLink: 'john-doe/30min' });
}

onMounted(() => {
  // Listen for Cal.com events (e.g. conversion tracking)
  // Passing autoCleanup = true unsubscribes on scope disposal
  on(
    {
      action: 'bookingSuccessful',
      callback: (event) => {
        console.log('Meeting confirmed:', event.detail);
      }
    },
    true
  );
});
</script>

<template>
  <button @mouseenter="handleHover" @click="openBooking">
    Book via Composable
  </button>
</template>

useCal() Methods

  • openModal({ calLink, namespace?, config? }): Opens the booking modal popup.
  • inline({ elementOrSelector, calLink, namespace?, config? }): Mounts an inline calendar into an element or CSS selector.
  • preload({ calLink, namespace? }): Preloads calendar assets for snappy responsiveness.
  • on({ action, namespace?, callback }, autoCleanup?): Subscribes to events (bookingSuccessful, linkReady, etc.).
  • off({ action, namespace?, callback? }): Unsubscribes from events.
  • setUI(uiOptions, namespace?): Dynamically adjusts UI options for a namespace.
  • getApi(namespace?): Returns a Promise resolving to the raw Cal API queue function.

Configuration Reference

createCal(options) Options

| Option | Type | Default | Description | | --- | --- | --- | --- | | origin | string | 'https://app.cal.com' | Cal origin URL (override for self-hosted instances). | | embedJsUrl | string | '{origin}/embed/embed.js' | Direct URL to embed.js script. | | namespace | string | undefined | Default global namespace. | | forwardQueryParams | boolean | true | Forward current URL query parameters to the Cal iframe. | | cssVarsPerTheme | CalCssVarsPerTheme | undefined | Brand colors per theme (e.g. { light: { 'cal-brand': '#2563eb' } }). | | theme | 'light' \| 'dark' \| 'auto' | undefined | Default theme setting. | | layout | 'month_view' \| 'week_view' \| 'column_view' | 'month_view' | Calendar layout style. | | hideEventTypeDetails| boolean | false | Hide event header details in the modal. | | useSlotsViewOnSmallScreen | boolean \| string | undefined | Responsive slots view for mobile viewports. |


Self-Hosted Cal.com Instances

For self-hosted instances, specify origin (and optionally embedJsUrl):

app.use(
  createCal({
    origin: 'https://cal.yourdomain.com',
    embedJsUrl: 'https://cal.yourdomain.com/embed/embed.js'
  })
);

Playgrounds

Test integrations locally in either standard Vue 3 or Nuxt 3:

# Run Vue 3 playground (default: http://localhost:3000)
npm run playground
# or
npm run playground:vue

# Run Nuxt 3 SSR playground (default: http://localhost:3000)
npm run playground:nuxt

License

MIT © Melvin Morato Borja