@getmicdrop/venue-calendar

中文文档
4.3.148发布于 2026/11/12UNLICENSEDTypeScriptESM + CJS近 30 天下载 8342

A customizable Svelte calendar component for displaying comedy events

原始使用文档
文档目录46 节
  1. Features
  2. Installation
  3. Quick Start
  4. Method 1: Auto-Mount (Easiest)
  5. Method 2: Web Component
  6. Method 3: JavaScript API
  7. Framework Integration
  8. React
  9. Error reporting and runtime config
  10. Vue 3
  11. Svelte
  12. Angular
  13. Configuration Options
  14. Tag attributes
  15. JavaScript API Options
  16. Event Object Structure
  17. Views
  18. Which view draws
  19. Attributes and a saved widget
  20. Looks
  21. WordPress Integration
  22. Styling
  23. Theming
  24. Using CSS Custom Properties
  25. Available CSS Variables
  26. Using JavaScript Theme Utilities
  27. Preset Themes
  28. Automatic Dark Mode
  29. Localization and the CDN bundle
  30. When the fetch cannot happen
  31. First paint is always English
  32. Browser Support
  33. Development
  34. Building the Package
  35. Project Structure
  36. Lockfile policy
  37. API Reference
  38. initVenueCalendar(options)
  39. autoMount()
  40. Component Events
  41. Troubleshooting
  42. Calendar not appearing
  43. Styles not applying
  44. Events not showing
  45. License
  46. Support

@getmicdrop/venue-calendar

A beautiful, customizable calendar component built with Svelte for displaying comedy events. Perfect for comedy clubs, venues, and event organizers who want to showcase their upcoming shows.

Features

✨ Six Views: Calendar, List, Gallery, Carousel, Featured and Tonight, plus eight looks 🎨 Beautiful UI: Modern, responsive design built with Tailwind CSS 📱 Mobile-Friendly: Swipe gestures, touch-optimized, responsive design 🔌 Easy Integration: Works with React, Vue, vanilla JS, and more 🌐 One script tag: Self-hosted bundle — paste one <script>, no build step 🎨 Styles included: The bundle injects its own CSS — no separate stylesheet to link ⚡ Auto-Mount: Automatically finds and mounts to designated containers 🎯 Customizable: Configure views, navigation, and more 🌙 Dark Mode: Built-in light, dark, and high-contrast themes ♿ Accessible: ARIA labels, keyboard navigation, screen reader support 🎫 Event Status: Visual badges for "On Sale", "Selling Fast", "Sold Out"

Installation

Add one <script> tag pointing at the Micdrop-hosted bundle. The package is private (not on npm/jsDelivr) — it is delivered from get-micdrop.com:

<script
  defer
  src="https://get-micdrop.com/embed/venue-calendar.iife.js"
></script>
  • No stylesheet to link. The bundle injects its own CSS at runtime, so a plain page with just this <script> renders fully styled.
  • Use defer (or async) so the bundle never blocks page parse. It is ~310 KB gzipped.
  • Serve your page over HTTPS. Checkout stores a Secure cart cookie, which Safari drops on non-secure (http://) pages.

Heads-up: the exact hosted URL is being finalized (Micdrop ticket MIC-1130). Confirm the address with Micdrop before going live.

The import { ... } from '@getmicdrop/venue-calendar' examples further down are for Micdrop-internal apps that build with a bundler and have registry access to the private package. Public sites (comedy clubs, etc.) use the <script> tag above — not npm install.

Quick Start

Method 1: Auto-Mount (Easiest)

Simply add a div with the class micdrop-calendar-container and the calendar will automatically mount:

<!DOCTYPE html>
<html>
  <head>
    <title>My Comedy Club</title>
    <!-- Preload the bundle while the page parses. defer keeps the
       <script> non-blocking; preload starts the fetch earlier. -->
    <link
      rel="preload"
      as="script"
      href="https://get-micdrop.com/embed/venue-calendar.iife.js"
    />
    <script
      defer
      src="https://get-micdrop.com/embed/venue-calendar.iife.js"
    ></script>
  </head>
  <body>
    <!-- Calendar auto-mounts here. Use data-organization-id to show all of an
       organization's shows, or data-venue-id for a single venue. -->
    <div
      class="micdrop-calendar-container"
      data-organization-id="your-organization-id"
      data-view="calendar"
      data-show-view-options="true"
      data-show-month-switcher="true"
      data-locale="en-US"
    ></div>
  </body>
</html>

Method 2: Web Component

Use the custom <micdrop-calendar> element:

<!DOCTYPE html>
<html>
  <head>
    <title>My Comedy Club</title>
    <script
      defer
      src="https://get-micdrop.com/embed/venue-calendar.iife.js"
    ></script>
  </head>
  <body>
    <!-- Web Component -->
    <micdrop-calendar
      venue-id="your-venue-id"
      view="calendar"
      show-view-options="true"
      show-month-switcher="true"
      locale="en-US"
    >
    </micdrop-calendar>
  </body>
</html>

Method 3: JavaScript API

For more control, use the JavaScript API:

<!DOCTYPE html>
<html>
  <head>
    <title>My Comedy Club</title>
  </head>
  <body>
    <div id="my-calendar"></div>

    <!-- Load the bundle, then call the global it exposes. -->
    <script
      defer
      src="https://get-micdrop.com/embed/venue-calendar.iife.js"
    ></script>
    <script>
      window.addEventListener('load', function () {
        window.VenueCalendar.initVenueCalendar({
          target: '#my-calendar',
          organizationId: 'your-organization-id',
          view: 'calendar',
          showViewOptions: true,
          showMonthSwitcher: true,
        });
      });
    </script>
  </body>
</html>

Framework Integration

React

import React, { useEffect, useRef } from 'react';
import { initVenueCalendar, unmount } from '@getmicdrop/venue-calendar';

function VenueCalendarComponent({ venueId, view = 'calendar' }) {
  const calendarRef = useRef(null);
  const instanceRef = useRef(null);

  useEffect(() => {
    if (!calendarRef.current) return;
    instanceRef.current = initVenueCalendar({
      target: calendarRef.current,
      venueId,
      view,
      events: [],
      showViewOptions: true,
      showMonthSwitcher: true,
    });

    return () => {
      // Svelte 5 — components mounted via `mount()` are destroyed via
      // the `unmount` helper, not `.$destroy()` (that was Svelte 4).
      if (instanceRef.current) {
        try {
          unmount(instanceRef.current);
        } catch {}
        instanceRef.current = null;
      }
    };
  }, [venueId, view]);

  return <div ref={calendarRef}></div>;
}

export default VenueCalendarComponent;

Error reporting and runtime config

Wire any errors caught by the widget into your existing monitoring:

import { configureVenueCalendar } from '@getmicdrop/venue-calendar';

configureVenueCalendar({
  onError: (err, { source }) => {
    Sentry.captureException(err, { tags: { source, micdrop: true } });
  },
  // Optional overrides for self-hosted backends or regional failover.
  // apiBaseUrl: 'https://api.eu.micdrop.com',
  // apiTimeout: 15000,
  // apiRetries: 2,
});

For ad-hoc support diagnostics, the widget exposes its version on window:

window.__MICDROP_CALENDAR__.version; // e.g. "3.6.23"

Venue pixels and visitor consent:

If your organization saved a Meta Pixel or Google Analytics 4 ID, the calendar loads it only after the visitor agrees. With no consent signal on the page it sends no Meta or Google request at all. Tell it the visitor said yes in any one of these ways:

<!-- your consent tool already said yes before the calendar loads -->
<div data-consent-granted="true" ...></div>
// from your cookie banner's "Accept" callback
window.__MICDROP_CALENDAR__.setConsentGranted(true);

A consent tool that speaks the IAB TCF API (__tcfapi) is picked up automatically. data-consent-required="false" tells the calendar your site does not need consent for these pixels; that is your own legal call, and a visitor whose browser sends Global Privacy Control still gets no pixels.

Usage in React App:

import React, { useState } from 'react';
import VenueCalendarComponent from './VenueCalendarComponent';

function App() {
  const [venueId, setVenueId] = useState('comedy-club-123');
  const [view, setView] = useState('calendar');

  return (
    <div style={{ padding: '20px' }}>
      <h1>Event Viewer</h1>

      <div style={{ marginBottom: '20px' }}>
        <label>Venue ID:</label>
        <input
          type="text"
          value={venueId}
          onChange={e => setVenueId(e.target.value)}
        />
      </div>

      <div style={{ marginBottom: '20px' }}>
        <label>Select View:</label>
        <label>
          <input
            type="radio"
            value="list"
            checked={view === 'list'}
            onChange={e => setView(e.target.value)}
          />
          List
        </label>
        <label>
          <input
            type="radio"
            value="gallery"
            checked={view === 'gallery'}
            onChange={e => setView(e.target.value)}
          />
          Gallery
        </label>
        <label>
          <input
            type="radio"
            value="calendar"
            checked={view === 'calendar'}
            onChange={e => setView(e.target.value)}
          />
          Calendar
        </label>
      </div>

      <VenueCalendarComponent venueId={venueId} view={view} />
    </div>
  );
}

export default App;

Vue 3

<template>
  <div ref="calendarContainer"></div>
</template>

<script setup>
import { ref, onMounted, onUnmounted, watch } from 'vue';
import { initVenueCalendar } from '@getmicdrop/venue-calendar';

const props = defineProps({
  venueId: String,
  view: {
    type: String,
    default: 'calendar',
  },
});

const calendarContainer = ref(null);
let calendarInstance = null;

onMounted(() => {
  calendarInstance = initVenueCalendar({
    target: calendarContainer.value,
    venueId: props.venueId,
    view: props.view,
    events: [],
    showViewOptions: true,
    showMonthSwitcher: true,
  });
});

onUnmounted(() => {
  if (calendarInstance && calendarInstance.$destroy) {
    calendarInstance.$destroy();
  }
});

watch(
  () => props.venueId,
  newId => {
    if (calendarInstance) {
      calendarInstance.$destroy();
      calendarInstance = initVenueCalendar({
        target: calendarContainer.value,
        venueId: newId,
        view: props.view,
        events: [],
        showViewOptions: true,
        showMonthSwitcher: true,
      });
    }
  }
);
</script>

Svelte

<script>
  import { VenueCalendar } from '@getmicdrop/venue-calendar';
  import { Calendar, Grid, List } from 'carbon-icons-svelte';
  import { writable } from 'svelte/store';

  let venueId = 'your-venue-id';
  let currentMonth = writable(new Date().getUTCMonth());
  let currentYear = writable(new Date().getUTCFullYear());

  function handleNext() {
    currentMonth.update(m => m + 1);
  }

  function handlePrev() {
    currentMonth.update(m => m - 1);
  }
</script>

<VenueCalendar
  showViewOptions={[
    { id: 0, text: 'List view', icon: List },
    { id: 1, text: 'Gallery view', icon: Grid },
    { id: 2, text: 'Calendar view', icon: Calendar },
  ]}
  showMonthSwitcher={true}
  events={[]}
  {currentMonth}
  {currentYear}
  {handleNext}
  {handlePrev}
  on:eventClick={e => console.log('Event clicked:', e.detail)}
/>

Host-page props — for a page that already owns part of what the widget draws. Every one defaults to on, so embeds are unchanged:

PropTypeDefaultDescription
checkoutProbebooleantrueAsk whether this page can sell a ticket and overlay the "Online ticket sales are unavailable here" alert when it cannot. false skips the probe and never draws the alert — for a host where no ticket is bought, such as a site builder's design canvas.
showGiftCardsLinkbooleantrueThe footer's "Gift cards" link. false for a host page whose own footer already carries it.
showPoweredBybooleantrueThe footer's "Powered by Micdrop" mark. false for a host page whose own footer already carries it.

Angular

import {
  Component,
  OnInit,
  OnDestroy,
  ElementRef,
  ViewChild,
} from '@angular/core';
import { initVenueCalendar } from '@getmicdrop/venue-calendar';

@Component({
  selector: 'app-venue-calendar',
  template: '<div #calendarContainer></div>',
})
export class VenueCalendarComponent implements OnInit, OnDestroy {
  @ViewChild('calendarContainer', { static: true })
  calendarContainer!: ElementRef;
  private calendarInstance: any;

  ngOnInit() {
    this.calendarInstance = initVenueCalendar({
      target: this.calendarContainer.nativeElement,
      venueId: 'your-venue-id',
      view: 'calendar',
      events: [],
      showViewOptions: true,
      showMonthSwitcher: true,
    });
  }

  ngOnDestroy() {
    if (this.calendarInstance && this.calendarInstance.$destroy) {
      this.calendarInstance.$destroy();
    }
  }
}

Configuration Options

Tag attributes

Every attribute below works on <micdrop-calendar> as written, and as its data- twin (data-view, data-venue-id, …) on <micdrop-calendar> or the auto-mount <div class="micdrop-calendar-container">. The auto-mount <div> reads the ones marked "div" in the last column; for the rest, use <micdrop-calendar> or a saved widget.

AttributeValuesDefaultWhat it doesdiv
venue-idvenue IDnoneThe venue whose shows draw✓
organization-idorganization IDnoneThe organization whose shows draw, for an embed across venues✓
widget-idsaved widget IDnoneLoads a widget saved in Micdrop: its view, filters, colors and display options; a div takes only its display options✓
widget-keywidget keynoneLets the widget read its shows from a site that is not Micdrop's own✓
viewsee ViewscalendarThe view the widget opens on✓
show-view-optionstrue / falsetrueDraws the view switcher✓
show-month-switchertrue / falsetrueDraws the month arrows✓
show-searchtrue / falsewith the switcherDraws the search box; true draws it without the view switcher, false hides it
show-powered-bytrue / falsetrueDraws the "Powered by Micdrop" line under the widget✓
show-backgroundtrue / falsetruePaints the widget's own canvas and outer insets; false sits it straight on the page
max-itemsa positive whole numberallHow many shows Gallery, List and Carousel draw
skip-itemsa whole number0How many of the first upcoming shows the List looks (look-list, look-board) leave out
event-detailsJSON, e.g. {"date":false}all onWhich card parts draw (poster, date, description); only false hides one
sizeS / M / LMHow big each view draws its shows
heading-level1 / 21Level of the screen-reader heading; 2 when the page already has its own h1✓
poster-fitfit / fillfitThe whole poster, or cropped to cover its box✓
poster-backdropblur / colorblurWhat fills around a fit poster✓
inject-seotrue / falsetrueOpening a show sets the page's title and share preview to the show's, restored when it closes✓
url-modepushState / nonepushStatenone keeps the widget from changing the page address (for iframe and Wix embeds)✓
localea language tag, e.g. en-USbrowser settingThe language and date format the widget draws in✓
api-basean origin, e.g. https://get-micdrop.comMicdrop's APIWhere the widget reads its shows from✓
public-site-originan originapi-baseWhere share links, event pages and gift-card links point✓
consent-requiredtrue / falseauto-detectedFor a non-TCF cookie banner: hold tracking until consent is granted✓
consent-grantedtrue / falseauto-detectedFor a non-TCF cookie banner: the visitor has granted consent✓

A true/false attribute is on when present (show-search or show-search="") and off only as ="false". A value that does not parse is ignored, and the widget keeps its default.

JavaScript API Options

initVenueCalendar({
  target: '.my-calendar', // CSS selector or HTMLElement (required)
  venueId: 'venue-123', // Venue ID (optional)
  view: 'calendar', // any view name under Views (default: 'calendar')
  events: [], // Array of event objects (default: [])
  showViewOptions: true, // Show view switcher (default: true)
  showMonthSwitcher: true, // Show month navigation (default: true)
});

Event Object Structure

{
  id: 'event-123',
  name: 'Comedy Night',
  date: '2024-10-25T20:00:00Z',
  image: 'https://example.com/image.jpg',
  status: 'On Sale',
  timeline: '8:00 PM - 10:00 PM',
  // ... other fields
}

Views

view takes one of six view names, or one of eight looks.

ViewWhat it draws
calendarThe default: a month grid of shows
listUpcoming shows in a vertical list
galleryA grid of show posters
carouselShows in a row that scrolls sideways
featuredOne show, large
tonightToday's shows, drawn as the Board look

Which view draws

The first match wins:

  1. ?view= in the page address, when it names a view. The view switcher writes it there, so a visitor's own pick and a shared link both win.
  2. The saved view of a <micdrop-calendar widget-id>.
  3. The view attribute.
  4. calendar.

Attributes and a saved widget

On <micdrop-calendar widget-id>, an attribute on the tag wins over the widget's saved display options: show-search, show-view-options, show-powered-by, show-background, event-details, max-items, skip-items and size. The saved view is the exception: it replaces view.

Looks

A look is a view with its card parts and size set, the starting points of Micdrop's widget builder.

ViewLook
look-featuredFeatured: one show as a stacked card
look-ticketTicket card: one show, the date set big
look-stripStrip: one show per slim row
look-listList: shows grouped under their day
look-boardBoard: a list led by each show's time
look-gridGrid: show cards in a grid
look-postersPoster wall: posters only
look-calendarCalendar: a month grid

WordPress Integration

For WordPress sites, you can add this to your page/post HTML:

<div
  class="micdrop-calendar-container"
  data-venue-id="your-venue-id"
  data-view="calendar"
></div>

<script src="https://get-micdrop.com/embed/venue-calendar.iife.js"></script>

Or add the script to your theme's footer and use the div anywhere in your content.

Styling

The calendar comes with built-in styles using Tailwind CSS. If you need to customize the appearance, you can override the CSS classes or add your own styles.

/* Example: Custom styling */
.micdrop-calendar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

Note: The mount target must not be a shrink-to-fit box (display: inline-block, float, position: absolute, display: table-cell, or an auto-width item in a flex row). The calendar sizes its typography to its own container, which requires the mount target to get its width from its parent — a normal block element (as in every example above) is exactly right. If the calendar detects a shrink-to-fit mount target, it falls back to page-width type scaling and logs a console warning.

Theming

The calendar supports comprehensive theming via CSS custom properties and JavaScript utilities.

Using CSS Custom Properties

Override the default theme by setting CSS custom properties:

/* Custom brand colors */
.micdrop-calendar-container {
  --brand-primary-fill: 270 76% 40%; /* Purple: buttons, today, tints */
  --brand-primary: 270 76% 40%; /* Links and outlines; must read on the page */
  --text-primary: 0 0% 10%;
  --bg-primary: 0 0% 100%;
}

/* Dark mode */
.dark .micdrop-calendar-container,
[data-theme='dark'] .micdrop-calendar-container {
  --brand-primary-fill: 270 76% 70%;
  --brand-primary: 270 76% 70%;
  --text-primary: 0 0% 95%;
  --bg-primary: 0 0% 10%;
}

Available CSS Variables

VariableDescriptionDefault (Light)
--brand-primary-fillBrand color behind text: buttons209 99% 44.5%
--brand-primaryBrand color as text: links, outlines209 99% 41.5%
--text-primaryMain text color0 0% 0%
--text-secondarySecondary text0 0% 40%
--bg-primaryMain background0 0% 100%
--bg-secondarySecondary background0 0% 98%
--stroke-primaryBorder colors0 0% 80%
--status-on-sale"On Sale" badge217 91% 60%
--status-selling-fast"Selling Fast" badge38 92% 50%
--status-sold-out"Sold Out" badge0 84% 60%
--today-bgToday's date background217 91% 97%
--focus-ringKeyboard focus ring217 91% 60%

Set both brand variables: a button reads --brand-primary-fill alone, so overriding only --brand-primary leaves filled controls in the default blue. applyTheme sets the fill and its text color for you.

Using JavaScript Theme Utilities

import {
  applyTheme,
  themes,
  generateThemeCSS,
} from '@getmicdrop/venue-calendar';

// Apply a preset theme
applyTheme(themes.dark);

// Apply to a specific container
const container = document.querySelector('.micdrop-calendar-container');
applyTheme(themes.dark, container);

// Create a custom theme
const myTheme = {
  brandPrimary: '270 76% 60%', // Purple
  textPrimary: '0 0% 10%',
  bgPrimary: '0 0% 100%',
  statusOnSale: '142 71% 45%', // Green for on sale
};
applyTheme(myTheme);

// Generate CSS string for embedding
const cssString = generateThemeCSS(myTheme);
console.log(cssString);
// Output: :root { --brand-primary: 270 76% 60%; ... }

Preset Themes

Three themes are included out of the box:

import { themes } from '@getmicdrop/venue-calendar';

// Light theme (default)
applyTheme(themes.light);

// Dark theme
applyTheme(themes.dark);

// High contrast (accessibility)
applyTheme(themes.highContrast);

Automatic Dark Mode

The calendar automatically respects the user's system preference:

/* Automatically applied when user prefers dark mode */
@media (prefers-color-scheme: dark) {
  /* Dark theme variables are applied */
}

You can also manually toggle dark mode:

<!-- Add 'dark' class to enable dark theme -->
<div class="dark">
  <div class="micdrop-calendar-container" data-venue-id="123"></div>
</div>

<!-- Or use data-theme attribute -->
<div data-theme="dark">
  <div class="micdrop-calendar-container" data-venue-id="123"></div>
</div>

Localization and the CDN bundle

The calendar and the checkout speak thirteen languages. English is built into the bundle; the other twelve are fetched at runtime, one file, only for the locale actually in use — so a buyer never downloads twelve languages to read one. This is what keeps the CDN bundle at ~594 KB gzipped instead of ~686 KB.

For the npm package nothing is required: your bundler code-splits the catalogues and addresses them itself.

For the <script> embed, the bundle works out where to fetch from by looking at the URL it was itself served from, and loads a version-pinned sibling:

https://get-micdrop.com/embed/venue-calendar.iife.js
https://get-micdrop.com/embed/locales/<version>/main/es.js   ← calendar copy
https://get-micdrop.com/embed/locales/<version>/flow/es.js   ← checkout copy

The calendar itself loads the same way. venue-calendar.iife.js is a small loader: it fetches the first piece (enough to draw a saved look's card) and, once the card is up, the rest of the widget, all from a version-pinned looks/<version>/ directory beside it. Until the rest has loaded, the window.VenueCalendar functions return promises that resolve to what the function returns; after that they are the functions themselves.

If you self-host the bundle, copy the dist/locales/, dist/looks/ and dist/checkout-libs/ directories alongside it. Version-pinned paths mean new releases only ever add files; they never overwrite the catalogue an older pinned bundle is using.

When the fetch cannot happen

If the locale file cannot be loaded — a Content-Security-Policy that allowlists the exact script file rather than the origin, an offline CDN, or a <script type="module"> embed where the bundle cannot see its own URL — the calendar simply stays in English. Nothing errors and nothing breaks; the widget renders and sells tickets exactly as it does for an English buyer.

The calendar's own files are a different matter: if looks/<version>/ cannot be loaded, nothing draws, and the console names the file that failed. The two overrides below fix the URL case; a Content-Security-Policy has to allow the get-micdrop.com/embed/ directory, not one file in it.

Two ways to point it at the right place when it cannot work it out:

<!-- Option A: tell it before the bundle loads -->
<script>
  window.__MICDROP_CALENDAR_ASSET_BASE__ = 'https://get-micdrop.com/embed/';
</script>
<script
  defer
  src="https://get-micdrop.com/embed/venue-calendar.iife.js"
></script>

<!-- Option B: put it on the tag -->
<script
  defer
  src="https://get-micdrop.com/embed/venue-calendar.iife.js"
  data-vc-base="https://get-micdrop.com/embed/"
></script>

defer and async need no override — a classic script still knows its own URL.

First paint is always English

A non-English buyer sees English for a moment on a cold load and the page swaps to their language when the catalogue arrives. This is deliberate: the calendar paints immediately rather than waiting on a translation file.

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

Development

Building the Package

# Install dependencies
npm install

# Build the library
npm run build:lib

# Development mode (SvelteKit app)
npm run dev

# Preview production build
npm run preview

build:lib is three passes and the order matters: the IIFE pass runs first and owns the dist/ wipe, the ES/UMD pass appends to it, and vite.config.locales.js appends the runtime locale catalogues (dist/locales/<version>/{main,flow}/<tag>.js) last. npm run size fails if the bundle and its catalogues do not both come out of that.

Project Structure

venue-calendar/
├── src/
│   ├── components/         # Svelte components
│   │   ├── Calendar/
│   │   ├── CalendarContainer/
│   │   └── Button/
│   ├── lib/               # Library entry points
│   │   ├── VenueCalendar.js
│   │   └── web-component.js
│   └── routes/            # SvelteKit routes (for dev)
├── dist/                  # Built package (generated)
│   └── locales/<version>/ # Runtime locale catalogues for the CDN bundle
├── package.json
├── vite.config.lib.js     # Library build config (ES/UMD + IIFE passes)
├── vite.config.locales.js # Emits the runtime locale catalogues
└── README.md

Lockfile policy

package-lock.json is the single canonical lockfile — CI and the publish workflow install with npm ci. Do not commit yarn.lock or pnpm-lock.yaml (both gitignored). Local dev machines may use pnpm for the svelte-components symlink workflow, but dependency changes must land in package-lock.json via npm.

API Reference

initVenueCalendar(options)

Initialize a calendar instance.

Parameters:

  • options (Object): Configuration options

Returns: Svelte component instance

Example:

const calendar = initVenueCalendar({
  target: '#calendar',
  venueId: 'venue-123',
  view: 'calendar',
});

autoMount()

Automatically mount calendars to all elements with class micdrop-calendar-container.

Example:

import { autoMount } from '@getmicdrop/venue-calendar';
autoMount();

Component Events

The calendar component emits events that you can listen to:

const calendar = initVenueCalendar({
  target: '#calendar',
  // ... other options
});

// Listen to component events (if using Svelte component directly)
calendar.$on('eventClick', event => {
  console.log('Event clicked:', event.detail);
});

Troubleshooting

Calendar not appearing

  1. Check the script is loaded: Open browser console and verify no errors
  2. Verify container exists: Make sure the target element exists in the DOM
  3. Check data attributes: Ensure attributes are correctly formatted with data- prefix

Styles not applying

  1. CSS not loaded: The styles are bundled in the JS file and auto-injected — no separate stylesheet needed
  2. CSS conflicts: Check if other styles are overriding the calendar styles
  3. Bundle didn't load: Confirm the <script src> points at the Micdrop-hosted bundle and returns 200 (not 404)

Events not showing

  1. Check event data format: Ensure events match the expected structure
  2. Date format: Use ISO 8601 format for dates (YYYY-MM-DDTHH:mm:ssZ)
  3. Venue ID: Verify the venue ID is correct

License

Proprietary. Copyright (c) 2026 Micdrop. All rights reserved. See LICENSE.

Support

For issues, questions, or feature requests, please visit: https://github.com/get-micdrop/venue-calendar/issues


Made with ❤️ by the MicDrop team

版本与发布记录

@getmicdrop/venue-calendar 共发布 478 个版本,首次发布于 2025/10/31;过去 12 个月发布了 467 个版本。

版本发布日期距今
4.3.148latest2026/11/124 天前
4.3.1462026/11/0510 天前
4.3.1432026/11/0411 天前
4.3.1422026/11/0412 天前
4.3.1412026/11/0412 天前
4.3.1402026/11/0313 天前

关于 @getmicdrop/venue-calendar 的常见问题

@getmicdrop/venue-calendar 是什么?

A customizable Svelte calendar component for displaying comedy events

如何安装 @getmicdrop/venue-calendar?

在项目目录运行 npm install @getmicdrop/venue-calendar,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:svelte(>=5.56.4 <6)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@getmicdrop/venue-calendar 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@getmicdrop/venue-calendar 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@getmicdrop/venue-calendar 可以商用吗?

@getmicdrop/venue-calendar 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@getmicdrop/venue-calendar 的下载量有多少?

根据 npm 官方下载统计,@getmicdrop/venue-calendar 在 2026/10/17 – 2026/11/15 这 30 天内被下载 8,342 次,日均约 278 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@getmicdrop/venue-calendar 还在维护吗?

最新版本 4.3.148 发布于 2026/11/12(4 天前);至今共发布 478 个版本,其中过去 12 个月发布了 467 个;首次发布于 2025/10/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。