Back

Documentation

Installation

CalendarKit offers two versions: Basic (free, open source) and Pro (premium features).

Basic (Free - Open Source)

Install directly from npm - no purchase needed! Includes month, week, and day views with event management.

  • ✓ Month, Week, Day views
  • ✓ Event creation & editing
  • ✓ Calendar filtering
  • ✓ Full TypeScript support
  • ✓ MIT License

Pro (Premium)

After purchase, you'll receive access to a private GitHub repository with full source code.

  • ✓ Everything in Basic
  • ✓ Drag & drop events
  • ✓ Event resizing with 15-min snapping
  • ✓ Agenda & Resource views
  • ✓ Dark mode & i18n
  • ✓ Timezone support
  • ✓ Recurring events (RRULE)
  • ✓ Event reminders & notifications
  • ✓ ICS import/export
  • ✓ Context menus (right-click)
  • ✓ Mobile swipe gestures
  • ✓ Skeleton loading & empty states
  • ✓ Event attachments & guests
  • ✓ Lifetime updates
# Basic (Free - Open Source)
# Install from npm - no purchase needed!
npm install calendarkit-basic
# or
yarn add calendarkit-basic
# or
pnpm add calendarkit-basic

# Pro (After Purchase)
# You'll receive access to our private GitHub repository.
# Clone the repository using your GitHub account:
git clone https://github.com/Zesor/pro-scheduler.git

# Install dependencies
cd pro-scheduler
npm install

# Run the development server
npm run dev

Basic Usage

The BasicScheduler component provides essential calendar functionality with month, week, and day views.

BasicScheduler Example
import { BasicScheduler } from 'calendarkit-basic';
import { CalendarEvent, ViewType } from 'calendarkit-basic';
import { useState } from 'react';

export default function MyCalendar() {
  const [events, setEvents] = useState<CalendarEvent[]>([]);
  const [view, setView] = useState<ViewType>('week');
  const [date, setDate] = useState(new Date());

  return (
    <BasicScheduler
      events={events}
      view={view}
      onViewChange={setView}
      date={date}
      onDateChange={setDate}
      onEventCreate={(event) => {
        setEvents([...events, { ...event, id: Date.now().toString() }]);
      }}
    />
  );
}

Pro UsagePro

The ProScheduler includes all Basic features plus drag & drop, agenda view, resource view, timezone support, dark mode, i18n, and recurring events.

ProScheduler Example
import { Scheduler } from '@/components/pro-scheduler';
import { CalendarEvent, ViewType, Resource } from '@/components/pro-scheduler/types';
import { useState } from 'react';

export default function MyCalendar() {
  const [events, setEvents] = useState<CalendarEvent[]>([]);
  const [view, setView] = useState<ViewType>('week');
  const [date, setDate] = useState(new Date());
  const [isDarkMode, setIsDarkMode] = useState(false);

  return (
    <Scheduler
      events={events}
      view={view}
      onViewChange={setView}
      date={date}
      onDateChange={setDate}
      isDarkMode={isDarkMode}
      onThemeToggle={() => setIsDarkMode(!isDarkMode)}
      onEventCreate={(event) => {
        setEvents([...events, { ...event, id: Date.now().toString() }]);
      }}
    />
  );
}

Events

Events are the core data structure in CalendarKit. Each event must have a unique ID, title, start, and end date.

CalendarEvent Interface
interface CalendarEvent {
  id: string;           // Unique identifier
  title: string;        // Event title
  start: Date;          // Start date/time
  end: Date;            // End date/time
  description?: string; // Optional description
  color?: string;       // Hex color (e.g., '#3b82f6')
  allDay?: boolean;     // Is all-day event
  calendarId?: string;  // Associated calendar ID
  resourceId?: string;  // For resource view (Pro only)
  guests?: string[];    // Email addresses (Pro only)
  attachments?: EventAttachment[]; // Files (Pro only)
  recurrence?: {        // Recurring rules (Pro only)
    freq: 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY';
    interval?: number;
    count?: number;     // Number of occurrences
    until?: Date;       // End date
  };
}

Required Fields

  • id - Unique identifier for the event
  • title - Display name of the event
  • start - JavaScript Date object for start time
  • end - JavaScript Date object for end time

Calendars

Calendars allow users to organize and filter events by category. Each calendar has a color and can be toggled on/off.

Calendar Filtering
const calendars = [
  { id: 'work', label: 'Work', color: '#3b82f6', active: true },
  { id: 'personal', label: 'Personal', color: '#10b981', active: true },
  { id: 'family', label: 'Family', color: '#8b5cf6', active: false },
];

<BasicScheduler
  events={events}
  calendars={calendars}
  onCalendarToggle={(id, active) => {
    setCalendars(cals =>
      cals.map(c => c.id === id ? { ...c, active } : c)
    );
  }}
/>

Event Handlers

CalendarKit provides callback functions for all user interactions. Use these to sync with your backend or state management.

Event Handlers
<ProScheduler
  events={events}
  // Called when user clicks on an event
  onEventClick={(event) => {
    console.log('Event clicked:', event);
  }}
  // Called when user creates a new event
  onEventCreate={(event) => {
    setEvents([...events, { ...event, id: Date.now().toString() }]);
  }}
  // Called when user updates an existing event
  onEventUpdate={(updatedEvent) => {
    setEvents(events.map(e =>
      e.id === updatedEvent.id ? updatedEvent : e
    ));
  }}
  // Called when user deletes an event
  onEventDelete={(eventId) => {
    setEvents(events.filter(e => e.id !== eventId));
  }}
  // Called when user drags an event to a new time (Pro only)
  onEventDrop={(event, newStart, newEnd) => {
    setEvents(events.map(e =>
      e.id === event.id ? { ...e, start: newStart, end: newEnd } : e
    ));
  }}
/>

BasicScheduler Props

Complete reference of all props available in BasicScheduler.

BasicScheduler Props Interface
// BasicScheduler Props
interface BasicSchedulerProps {
  // Data
  events?: CalendarEvent[];
  calendars?: Calendar[];

  // View Control
  view?: 'month' | 'week' | 'day';
  onViewChange?: (view: ViewType) => void;
  date?: Date;
  onDateChange?: (date: Date) => void;

  // Event Handlers
  onEventClick?: (event: CalendarEvent) => void;
  onEventCreate?: (event: Partial<CalendarEvent>) => void;
  onEventUpdate?: (event: CalendarEvent) => void;
  onEventDelete?: (eventId: string) => void;
  onCalendarToggle?: (calendarId: string, active: boolean) => void;

  // Customization
  theme?: CalendarTheme;
  locale?: Locale;
  className?: string;
  readOnly?: boolean;
  isLoading?: boolean;

  // Custom Rendering
  renderEventForm?: (props: EventFormProps) => React.ReactNode;
}
PropTypeDefaultDescription
eventsCalendarEvent[][]Array of events to display
view'month' | 'week' | 'day''week'Current calendar view
dateDatenew Date()Currently focused date
calendarsCalendar[]undefinedCalendar categories for filtering
localeLocaleundefineddate-fns locale for date formatting
readOnlybooleanfalseDisable event creation/editing
isLoadingbooleanfalseShow loading state

BasicScheduler Views

Month View

Traditional calendar grid showing all days in the current month. Events are displayed as colored bars.

Week View

7-day view with hourly grid. Shows event duration visually. Virtualized for performance.

Day View

Single day view with detailed hourly breakdown. 15-minute time slots for precise scheduling.

ProScheduler PropsPro

ProScheduler extends BasicScheduler with additional features. All Basic props are available plus:

ProScheduler Props Interface
// ProScheduler Props (includes all BasicScheduler props)
interface ProSchedulerProps extends BasicSchedulerProps {
  // Additional Views
  view?: 'month' | 'week' | 'day' | 'agenda' | 'resource';
  resources?: Resource[];

  // Drag & Drop
  onEventDrop?: (event: CalendarEvent, start: Date, end: Date) => void;
  onEventResize?: (event: CalendarEvent, start: Date, end: Date) => void;

  // Timezone
  timezone?: string;
  onTimezoneChange?: (timezone: string) => void;

  // Theme
  isDarkMode?: boolean;
  onThemeToggle?: () => void;

  // i18n
  language?: 'en' | 'fr';
  onLanguageChange?: (lang: 'en' | 'fr') => void;
  translations?: Partial<CalendarTranslations>;

  // Pro Features
  eventTypes?: EventType[];
  hideViewSwitcher?: boolean;
}
PropTypeDescription
timezonestringIANA timezone (e.g., 'America/New_York')
isDarkModebooleanEnable dark theme
language'en' | 'fr'UI language for built-in translations
translationsCalendarTranslationsCustom translation overrides
resourcesResource[]Resources for resource view
onEventDropfunctionCallback when event is dragged
onEventResizefunctionCallback when event is resized
hideViewSwitcherbooleanHide the view toggle buttons

ProScheduler ViewsPro

All Basic Views

Month, Week, and Day views with drag & drop support.

Agenda View Pro

List view showing upcoming events in chronological order. Perfect for quick overview.

Resource View Pro

Display events by resource (rooms, people, equipment). Ideal for booking systems.

ThemingPro

Customize colors, fonts, and border radius. Includes built-in dark mode support.

Custom Theme Configuration
const customTheme = {
  colors: {
    primary: '#6366f1',      // Primary accent color
    secondary: '#ec4899',    // Secondary color
    background: '#ffffff',   // Background color
    foreground: '#0f172a',   // Text color
    border: '#e2e8f0',       // Border color
    muted: '#f1f5f9',        // Muted backgrounds
    accent: '#f1f5f9',       // Accent backgrounds
  },
  fontFamily: 'Inter, sans-serif',
  borderRadius: '0.75rem',
};

<ProScheduler
  events={events}
  theme={customTheme}
  isDarkMode={isDarkMode}
  onThemeToggle={() => setIsDarkMode(!isDarkMode)}
/>

InternationalizationPro

Built-in support for English and French. Add custom translations for any language.

i18n Configuration
import { fr, de, es } from 'date-fns/locale';

// Custom translations
const customTranslations = {
  today: 'Heute',
  month: 'Monat',
  week: 'Woche',
  day: 'Tag',
  createEvent: 'Ereignis erstellen',
  editEvent: 'Ereignis bearbeiten',
  delete: 'Löschen',
  save: 'Speichern',
  cancel: 'Abbrechen',
  // ... more translations
};

<ProScheduler
  events={events}
  language="fr"                    // Built-in: 'en' | 'fr'
  locale={fr}                      // date-fns locale for date formatting
  translations={customTranslations} // Override specific strings
  onLanguageChange={(lang) => setLanguage(lang)}
/>

Timezone SupportPro

Display events in any timezone. Users can switch timezones on the fly.

Timezone Configuration
<ProScheduler
  events={events}
  timezone="America/New_York"      // IANA timezone
  onTimezoneChange={(tz) => {
    setTimezone(tz);
    // Events will automatically adjust to new timezone
  }}
/>

// Supported timezones include:
// - America/New_York
// - America/Los_Angeles
// - Europe/London
// - Europe/Paris
// - Asia/Tokyo
// - And all IANA timezone identifiers

Resource ViewPro

Display events by resource - perfect for room booking, team scheduling, or equipment allocation.

Resource View Setup
const resources = [
  { id: 'room-a', label: 'Conference Room A', color: '#3b82f6' },
  { id: 'room-b', label: 'Conference Room B', color: '#10b981' },
  { id: 'john', label: 'John Doe', color: '#f59e0b', avatar: '/avatars/john.jpg' },
];

const events = [
  {
    id: '1',
    title: 'Client Meeting',
    start: new Date(2025, 0, 15, 10, 0),
    end: new Date(2025, 0, 15, 11, 0),
    resourceId: 'room-a',  // Link event to resource
  },
];

<ProScheduler
  events={events}
  resources={resources}
  view="resource"
/>

Recurring EventsPro

Create events that repeat daily, weekly, monthly, or yearly. Supports count-based and date-based end rules.

Recurring Event Examples
const recurringEvents = [
  {
    id: '1',
    title: 'Daily Standup',
    start: new Date(2025, 0, 6, 9, 0),
    end: new Date(2025, 0, 6, 9, 30),
    recurrence: {
      freq: 'DAILY',
      interval: 1,      // Every 1 day
      count: 30,        // Repeat 30 times
    },
  },
  {
    id: '2',
    title: 'Weekly Team Meeting',
    start: new Date(2025, 0, 6, 14, 0),
    end: new Date(2025, 0, 6, 15, 0),
    recurrence: {
      freq: 'WEEKLY',
      interval: 1,
      until: new Date(2025, 12, 31), // End date
    },
  },
  {
    id: '3',
    title: 'Monthly Report',
    start: new Date(2025, 0, 1, 10, 0),
    end: new Date(2025, 0, 1, 11, 0),
    recurrence: {
      freq: 'MONTHLY',
      interval: 1,
      count: 12,
    },
  },
];

Recurrence Options

  • freq - Frequency: DAILY, WEEKLY, MONTHLY, YEARLY
  • interval - Repeat every N periods (default: 1)
  • count - Total number of occurrences
  • until - End date for recurrence

Event ResizingPro

Drag the bottom edge of events to resize them directly in the week and day views. Events snap to 15-minute intervals with visual feedback during resize.

Event Resizing
// Event resizing is enabled by default in ProScheduler
// Users can drag the bottom edge of events to resize them

<Scheduler
  events={events}
  // Called when user resizes an event by dragging
  onEventResize={(event, newStart, newEnd) => {
    setEvents(events.map(e =>
      e.id === event.id ? { ...e, start: newStart, end: newEnd } : e
    ));
  }}
/>

// The ResizableEvent component handles:
// - 15-minute snap intervals for precise scheduling
// - Visual feedback during resize (cursor, preview)
// - Minimum duration constraints

Features

  • ✓ Drag bottom edge to resize events
  • ✓ 15-minute snap intervals
  • ✓ Visual feedback during resize
  • ✓ Works in Week and Day views

Notification RemindersPro

Add reminder notifications to events with predefined intervals. Users can set multiple reminders per event.

Event Reminders
// Events can have multiple reminders
interface EventReminder {
  id: string;
  minutes: number;  // Minutes before event
  type: 'notification' | 'email';
}

const event: CalendarEvent = {
  id: '1',
  title: 'Team Meeting',
  start: new Date(2025, 0, 15, 14, 0),
  end: new Date(2025, 0, 15, 15, 0),
  reminders: [
    { id: 'r1', minutes: 15, type: 'notification' },  // 15 min before
    { id: 'r2', minutes: 60, type: 'email' },         // 1 hour before
  ],
};

// Built-in reminder options in EventModal:
// - 5 minutes before
// - 10 minutes before
// - 15 minutes before
// - 30 minutes before
// - 1 hour before
// - 1 day before

Reminder Options

  • ✓ 5, 10, 15, 30 minutes before
  • ✓ 1 hour before
  • ✓ 1 day before
  • ✓ Multiple reminders per event

ICS Import/ExportPro

Import and export calendar events in the standard ICS format. Compatible with Google Calendar, Apple Calendar, Outlook, and more.

ICS Import/Export
import { generateICS, parseICS } from '@/lib/ics';

// Export events to ICS file
const handleExport = () => {
  const icsContent = generateICS(events, calendars);
  const blob = new Blob([icsContent], { type: 'text/calendar' });
  const url = URL.createObjectURL(blob);

  const link = document.createElement('a');
  link.href = url;
  link.download = 'calendar.ics';
  link.click();
};

// Import events from ICS file
const handleImport = async (file: File) => {
  const text = await file.text();
  const importedEvents = parseICS(text);
  setEvents([...events, ...importedEvents]);
};

// Supports:
// - Recurring events (RRULE)
// - All-day events
// - Event attachments
// - Multiple calendars

Supported Features

  • ✓ Full ICS generation and parsing
  • ✓ Recurring events support
  • ✓ All-day events
  • ✓ Attachments support
  • ✓ Import/Export buttons in Sidebar

Context MenusPro

Right-click on events to access quick actions like edit, delete, and duplicate.

Context Menu Usage
// Context menus appear on right-click
// Use the useEventContextMenu hook for custom actions

import { useEventContextMenu } from '@/hooks/useEventContextMenu';

function MyScheduler() {
  const { contextMenu, handleContextMenu, closeContextMenu } =
    useEventContextMenu();

  return (
    <Scheduler
      events={events}
      onEventContextMenu={handleContextMenu}
      // Built-in actions: Edit, Delete, Duplicate
      onEventEdit={(event) => openEditModal(event)}
      onEventDelete={(eventId) => deleteEvent(eventId)}
      onEventDuplicate={(event) => {
        const duplicate = { ...event, id: Date.now().toString() };
        setEvents([...events, duplicate]);
      }}
    />
  );
}

Available Actions

  • ✓ Edit event
  • ✓ Delete event
  • ✓ Duplicate event
  • ✓ Customizable via useEventContextMenu hook

Mobile Swipe GesturesPro

Navigate between dates with intuitive swipe gestures on mobile devices.

Swipe Gesture Configuration
// Swipe gestures are automatically enabled on touch devices
import { useSwipeGesture } from '@/hooks/useSwipeGesture';

// The hook provides swipe detection with configurable threshold
const { swipeDirection, swipeHandlers } = useSwipeGesture({
  threshold: 50,  // Minimum swipe distance in pixels
  onSwipeLeft: () => navigateToNextPeriod(),
  onSwipeRight: () => navigateToPreviousPeriod(),
});

// Usage in custom component
<div {...swipeHandlers}>
  <CalendarContent />
</div>

// Built into ProScheduler:
// - Swipe left: Go to next week/month/day
// - Swipe right: Go to previous week/month/day
// - Works in all calendar views

Features

  • ✓ Swipe left/right to navigate dates
  • ✓ Configurable swipe threshold (default: 50px)
  • ✓ Works across all views
  • ✓ useSwipeGesture hook for custom implementations

Loading States & Empty StatesPro

Beautiful skeleton loading animations and empty state displays for a polished user experience.

Loading & Empty States
// Show loading skeleton
<Scheduler
  events={events}
  isLoading={isLoadingEvents}  // Shows skeleton when true
/>

// Skeleton components available:
// - MonthViewSkeleton
// - WeekViewSkeleton
// - DayViewSkeleton
// - AgendaViewSkeleton

// Empty states are shown automatically when:
// - No events exist for the current view
// - All calendars are filtered out

// Customize empty state
<Scheduler
  events={events}
  emptyStateMessage="No meetings scheduled"
  emptyStateAction={{
    label: "Schedule a meeting",
    onClick: () => openNewEventModal(),
  }}
/>

Skeleton Loading

Per-view skeleton loaders (Month, Week, Day, Agenda) that automatically display when isLoading is true.

Empty States

View-specific illustrations and messages with CTA button to create events.

Custom Event Form

Replace the built-in event form with your own custom component.

Custom Event Form
<ProScheduler
  events={events}
  renderEventForm={({ isOpen, onClose, event, initialDate, onSave, onDelete }) => (
    <MyCustomModal isOpen={isOpen} onClose={onClose}>
      <MyEventForm
        event={event}
        initialDate={initialDate}
        onSave={(data) => {
          onSave(data);
          onClose();
        }}
        onDelete={event?.id ? () => {
          onDelete?.(event.id);
          onClose();
        } : undefined}
      />
    </MyCustomModal>
  )}
/>