# Introduction

CalendarKit Pro (calendarkit-pro on npm) is a free, MIT-licensed React calendar and scheduler component for React 18 and 19.

## Installation

```bash
npm install calendarkit-pro
```

React 18 or 19 is the only requirement. Upgrading from 1.x? See [MIGRATION.md](https://calendarkit.io/docs/migration).

## Quick start

Give the calendar its events and let it keep them. That is the whole setup: the styles come with the component.

```tsx
import { Scheduler } from 'calendarkit-pro';

const events = [
  { id: '1', title: 'Design review', start: new Date(2026, 9, 15, 10), end: new Date(2026, 9, 15, 11) },
  { id: '2', title: 'Offsite', start: new Date(2026, 9, 19), end: new Date(2026, 9, 21), allDay: true },
];

export function MyCalendar() {
  return (
    <div style={{ height: 720 }}>
      <Scheduler defaultEvents={events} onEventsChange={(next) => save(next)} />
    </div>
  );
}
```

The calendar fills its parent: give the parent a height. `onEventsChange` receives the full list after every create, edit, move, resize, duplicate, delete or undo.

### Keeping the events in your state

To own the list (to sync it with an API, for example), pass `events` and update it from the callbacks:

```tsx
import { useState } from 'react';
import { Scheduler, type CalendarEvent } from 'calendarkit-pro';

export function MyCalendar() {
  const [events, setEvents] = useState<CalendarEvent[]>([]);

  return (
    <Scheduler
      events={events}
      onEventCreate={(event) => setEvents((list) => [...list, { ...event, id: crypto.randomUUID() } as CalendarEvent])}
      onEventUpdate={(event) => setEvents((list) => list.map((e) => (e.id === event.id ? event : e)))}
      onEventDelete={(id) => setEvents((list) => list.filter((e) => e.id !== id))}
    />
  );
}
```

### Next.js and server rendering

`calendarkit-pro` is marked `"use client"`, so it can be imported from a Server Component page. It renders on the server without touching `window`, and the page hydrates without a warning. Under a strict Content-Security-Policy, see [Styles and Content-Security-Policy](https://calendarkit.io/docs/theming#styles-and-content-security-policy).
