Event Calendar
Complete reference for the Event Calendar component — data model, configuration, interaction, and API.
import { useRef, useEffect } from 'react';
import { EventCalendar, EventCalendarRef } from '@timelinekit/react';
import '@timelinekit/core/styles';
function day(offset: number, hour?: number) {
const d = new Date();
d.setDate(d.getDate() + offset);
if (hour !== undefined) d.setHours(hour, 0, 0, 0);
return d.toISOString();
}
function date(offset: number) {
const d = new Date();
d.setDate(d.getDate() + offset);
return d.toISOString().slice(0, 10);
}
export default function App() {
const ref = useRef<EventCalendarRef>(null);
useEffect(() => {
ref.current?.load(JSON.stringify({
calendars: [
{ id: 'c1', name: 'Work', color: 0, isVisible: true, isDefault: true },
{ id: 'c2', name: 'Personal', color: 3, isVisible: true },
],
items: [
{ id: '1', calendarId: 'c1', title: 'Sprint Planning',
startTime: day(0, 9), endTime: day(0, 11), type: 'meeting' },
{ id: '2', calendarId: 'c1', title: 'Code Review',
startTime: day(1, 14), endTime: day(1, 15), type: 'appointment' },
{ id: '3', calendarId: 'c2', title: 'Vacation',
startTime: date(3), endTime: date(7), isAllDay: true, type: 'holiday' },
],
}));
}, []);
return (
<div style={{ height: '100vh' }}>
<EventCalendar ref={ref} />
</div>
);
}All API examples use calendar as shorthand for the component instance — i.e. ref.current in React or this.calendar in Angular.
Data→
Calendars, calendar items, item types, recurrence rules & exceptions, custom properties.
Configuration→
Views, first day of week, working hours, slot duration, week numbers, agenda days, navigation sync, sidebar, custom rendering & tooltips.
Interaction→
Context menus, drag & drop, selection, event creation, recurring event editing, keyboard, filtering, undo & redo, and backend sync.
Features→
iCalendar import/export, mini calendar, calendar list, export, and serialization.
Theming & Localization→
Built-in themes, custom styling, and multi-language support.
API Reference→
Properties, methods, events, and types.