---
title: "Event Calendar"
description: "A team calendar with Month, Week, Day, and Agenda views. People move and resize events with the pointer, touch, or keys. A failed save goes back."
url: https://gelatinui.com/components/event-calendar
markdown_url: https://gelatinui.com/components/event-calendar.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/event-calendar"
version: "2026-11-10"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Event Calendar

> A team calendar with Month, Week, Day, and Agenda views. People move and resize events with the pointer, touch, or keys. A failed save goes back.

Page: https://gelatinui.com/components/event-calendar

## When to use it

Best for: A full calendar of events that people read and change in place, in Month, Week, Day, or Agenda.

- Pass `events` and `onEventsChange`, or `defaultEvents` for a list that the calendar owns.
- Return a promise from `onEventsChange` to save: a rejection puts the event back and shows Retry.
- Set `variant` to `soft`, `solid`, or `card` for the look of every event.
- Use `onSlotSelect` to open your own form for a new event.

## When not to use it

- To pick one date, use a [Date Picker](https://gelatinui.com/components/date-picker.md).
- To pick a free time in one day, use [Time Slots](https://gelatinui.com/components/time-slots.md).
- For a small month with marks on days, use a [Calendar](https://gelatinui.com/components/calendar.md).

## Notes for agents

- Each event has `id`, `title`, `color`, and `span`. A timed span holds `ZonedDateTime` values; an all-day span holds `CalendarDate` values (`@internationalized/date`).
- The app expands recurring events: pass one event per instance.
- `timeZone` sets the wall clock of the grid; each timed span keeps its own zone.
- `readOnly` stops moves and resizes; a press still opens the details. `readOnly` on one event does the same for it.
- `status` is `ready`, `loading`, `empty`, or `error`. The grid stays on screen in each one; `onRetry` adds Retry to the error bar.
- With no children, the calendar renders its default toolbar, views, states, and details. Compose the parts for your own order.
- Pass a function as the child of `EventCalendarDetails` to add actions with `EventCalendarDetailsActions`.
- A phone has no Week view; the Day view gets the week strip.

## Anatomy

```text
EventCalendarRootProvider
└─ EventCalendar (0..n)
   ├─ EventCalendarBody (0..n)
   ├─ EventCalendarEmpty (0..n)
   ├─ EventCalendarError (0..n)
   ├─ EventCalendarSaveError (0..n)
   ├─ EventCalendarHeader (0..n)
   ├─ EventCalendarToday (0..n)
   ├─ EventCalendarPrevious (0..n)
   ├─ EventCalendarNext (0..n)
   ├─ EventCalendarTitle (0..n)
   ├─ EventCalendarRange (0..n)
   ├─ EventCalendarViewSwitch (0..n)
   ├─ EventCalendarDetails (0..n)
   ├─ EventCalendarDetailsHeader (0..n)
   ├─ EventCalendarDetailsTitle (0..n)
   ├─ EventCalendarDetailsTime (0..n)
   ├─ EventCalendarDetailsPlace (0..n)
   ├─ EventCalendarDetailsPeople (0..n)
   ├─ EventCalendarDetailsActions (0..n)
   ├─ EventCalendarEventTitle (0..n)
   ├─ EventCalendarEventTime (0..n)
   ├─ EventCalendarWeekView (0..n)
   ├─ EventCalendarDayView (0..n)
   ├─ EventCalendarMonthView (0..n)
   ├─ EventCalendarAgendaView (0..n)
   └─ EventCalendarWeekStrip (0..n)
```

## API reference

### EventCalendarBody

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### EventCalendarEmpty

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### EventCalendarError

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `children` | `ReactNode` |  | More actions beside "Retry". |

### EventCalendarSaveError

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `children` | `ReactNode` |  | More actions beside "Retry". |

### EventCalendarHeader

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### EventCalendarDetails

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `arrow` | `boolean` |  | Show an arrow that points at the trigger. The gap grows from 4px to 8px. |
| `backdrop` | `boolean` |  | Put a clear layer under the popup (Base UI `Popover.Backdrop`), for example to dim it. |
| `padding` | `"default" \| "none" \| "tight"` |  | `default`: radius 14, 12px padding and 10px between the parts, 288px wide. `tight`: 4px padding and 4px between the parts, as wide as the content: a row of 28px actions (a plain Toolbar) with the 4px inset of the bar recipe, 38px high (the selection pill of the Quote Reply). `none`: no padding and no gap, as wide as the content: a panel that lays out its own parts edge to edge (a head with a rule, a scroll box, a docked composer: the Chat Popup). Give it a width and a height with layout classes; the body fills that height. |
| `portalProps` | `Omit` |  | Other Base UI props of the inner parts. A `className` here adds to the component classes. |
| `positionerProps` | `PopupPartProps` |  |  |
| `backdropProps` | `PopupPartProps<PopoverBackdropProps>` |  |  |
| `arrowProps` | `PopupPartProps<PopoverArrowProps>` |  |  |
| `closeButtonProps` | `PopupPartProps` |  |  |
| `children` | `function \| ReactNode` |  | The parts inside, or a function of the event for its actions. Default: the four info parts. |

Also takes every prop of Base UI `Popover.Portal`: https://base-ui.com/react/components/popover

### EventCalendarDetailsHeader

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### EventCalendar

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `CalendarDate` |  | The anchor date at first. Default: today in the zone. On a server-rendered page the first render uses the server day, and today in the browser comes after hydration. |
| `defaultView` | `CalendarView` |  | The view at first. Default `week`. |
| `defaultEvents` | `readonly Readonly` |  |  |
| `defaultTimeZone` | `string` |  | The zone at first. Default: the zone of the browser. On a server-rendered page the first render uses UTC, and the browser zone comes after hydration. |
| `onEventsChange` | `function` |  | The app saves here. Return a promise to hold the new place until it settles: a rejected promise puts the event back and shows "Retry". With `events`, set the new list when it resolves. |
| `value` | `CalendarDate` |  | The anchor date. Any day inside the range to show. |
| `onValueChange` | `function` |  |  |
| `view` | `CalendarView` |  |  |
| `onViewChange` | `function` |  |  |
| `events` | `readonly SchedulingEvent[]` |  | The list of events. The app expands recurring events: each one is one instance. |
| `timeZone` | `string` |  | The IANA zone of the grid. |
| `onTimeZoneChange` | `function` |  |  |
| `views` | `readonly CalendarView[]` |  | The views on offer. Default all four; a phone drops `week`. |
| `slotMinutes` | `number` |  | The size of one step of a move, in minutes. Default 15. |
| `status` | `DataStatus` |  | The load state. The grid stays on screen in each one. Default `ready`. |
| `onRetry` | `function` |  | "Retry" of the `error` status. |
| `onSlotSelect` | `function` |  | A press or Enter on a free slot: the span of a new event. |
| `onEventSelect` | `function` |  | The selected event changed: open your own panel from it. |
| `readOnly` | `boolean` |  | No move and no resize. A press still opens the details. |
| `disabled` | `boolean` |  | No press and no focus on the grid; the toolbar is off. |
| `variant` | `EventCalendarVariant` |  | The look of every event: `soft` (default), a tint of the event color with a ring of the same hue; `solid`, the event color as the fill; `card`, a neutral card with a dot of the event color. |
| `now` | `number \| Date` |  | The fixed time of a story or a test. Default: the page clock. |
| `locale` | `string` |  |  |
| `weekStart` | `WeekStart` |  | The first day of a week. Default: from the locale. |
| `labels` | `Partial<EventCalendarLabels>` |  |  |
| `driverRef` | `Ref<DragDriver<string> \| null>` |  | A drag that code drives (a staged scene, a test): `pickUp(at, eventId)` presses the event at `at` (on its end handle: a resize), `carry` moves, `drop` saves, `putBack` cancels. It goes through the same machine as a pointer drag, and sends no pointer event. |

### EventCalendarEventTitle

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### EventCalendarEventTime

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### EventCalendarWeekView

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `EventContentRender` |  | The content of each event. Default: `EventCalendarEventTitle` and `EventCalendarEventTime`. |
| `startHour` | `number` |  | The first hour the grid shows. Default 0. |
| `endHour` | `number` |  | The hour the grid ends at. Default 24. |
| `scrollToHour` | `number` |  | The hour at the top when the view opens. |

### EventCalendarDayView

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `EventContentRender` |  | The content of each event. Default: `EventCalendarEventTitle` and `EventCalendarEventTime`. |
| `startHour` | `number` |  | The first hour the grid shows. Default 0. |
| `endHour` | `number` |  | The hour the grid ends at. Default 24. |
| `scrollToHour` | `number` |  | The hour at the top when the view opens. |

### EventCalendarMonthView

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `EventContentRender` |  | The content of each event. Default: `EventCalendarEventTitle` and `EventCalendarEventTime`. |

### EventCalendarAgendaView

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### EventCalendarWeekStrip

No props of its own: `className`, `children`, and every other prop go to the element it renders.

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| EventCalendarBody | `event-calendar-body` | `data-status` |  |  |
| EventCalendarEmpty | `event-calendar-empty` |  |  |  |
| EventCalendarError | `event-calendar-error` |  |  |  |
| EventCalendarSaveError | `event-calendar-save-error` |  |  |  |
| EventCalendarHeader | `event-calendar-header` |  |  |  |
| EventCalendarToday | `event-calendar-today` |  |  |  |
| EventCalendarPrevious | `event-calendar-previous` |  |  |  |
| EventCalendarNext | `event-calendar-next` |  |  |  |
| EventCalendarTitle | `event-calendar-title` |  |  |  |
| EventCalendarRange | `event-calendar-range` |  |  |  |
| EventCalendarViewSwitch | `event-calendar-view-switch` |  |  |  |
| EventCalendarDetails | `event-calendar-details` |  |  |  |
| EventCalendarDetailsHeader | `event-calendar-details-header` |  |  |  |
| EventCalendarDetailsTitle | `event-calendar-details-title` |  | `--event-calendar-color` |  |
| EventCalendarDetailsTime | `event-calendar-details-time` |  |  |  |
| EventCalendarDetailsPlace | `event-calendar-details-place` |  |  |  |
| EventCalendarDetailsPeople | `event-calendar-details-people` |  |  |  |
| EventCalendarDetailsActions | `event-calendar-details-actions` |  |  |  |
| EventCalendarRootProvider | `event-calendar` | `data-disabled` |  |  |
| EventCalendar | `event-calendar` | `data-disabled` |  |  |
| EventCalendarEventTitle | `event-calendar-event-title` | `data-cancelled` |  |  |
| EventCalendarEventTime | `event-calendar-event-time` | `data-short` | `--event-calendar-time`, `--muted-foreground` |  |
| EventCalendarWeekView | `event-calendar-week-view` |  |  |  |
| EventCalendarDayView | `event-calendar-day-view` |  |  |  |
| EventCalendarMonthView | `event-calendar-month-view` |  |  |  |
| EventCalendarAgendaView | `event-calendar-agenda-view` |  |  |  |
| EventCalendarWeekStrip | `event-calendar-week-strip` | `data-today` |  |  |

## Usage

Put the navigation in the header and the views in the body. The calendar shows the view that is on.

```tsx title="team-calendar.tsx"
"use client";

import { parseZonedDateTime } from "@internationalized/date";
import { useState } from "react";

import {
  EventCalendar,
  EventCalendarBody,
  EventCalendarHeader,
  EventCalendarNext,
  EventCalendarPrevious,
  EventCalendarTitle,
  EventCalendarToday,
  EventCalendarViewSwitch,
} from "@/components/pro/scheduling/event-calendar";
import {
  EventCalendarAgendaView,
  EventCalendarMonthView,
  EventCalendarWeekView,
} from "@/components/pro/scheduling/event-calendar-views";
import type { SchedulingEvent } from "@/lib/pro/scheduling-model";

function meeting(id: string, title: string, start: string, end: string): SchedulingEvent {
  return {
    id,
    title,
    span: {
      kind: "timed",
      start: parseZonedDateTime(`${start}[Europe/Berlin]`),
      end: parseZonedDateTime(`${end}[Europe/Berlin]`),
    },
  };
}

const TEAM_WEEK = [
  meeting("standup", "Standup", "2026-11-16T09:00", "2026-11-16T09:15"),
  meeting("review", "Design review · Checkout", "2026-11-17T10:00", "2026-11-17T11:00"),
  meeting("call", "Customer call · Lumen Health", "2026-11-19T15:30", "2026-11-19T16:15"),
];

export function TeamCalendar() {
  const [events, setEvents] = useState<readonly SchedulingEvent[]>(TEAM_WEEK);
  return (
    <EventCalendar events={events} onEventsChange={setEvents} defaultView="week" weekStart="mon">
      <EventCalendarHeader>
        <EventCalendarTitle className="me-auto" />
        <EventCalendarPrevious />
        <EventCalendarToday />
        <EventCalendarNext />
        <EventCalendarViewSwitch />
      </EventCalendarHeader>
      <EventCalendarBody>
        <EventCalendarMonthView />
        <EventCalendarWeekView />
        <EventCalendarAgendaView />
      </EventCalendarBody>
    </EventCalendar>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/event-calendar
```

It adds 78 registry items: 76 files, 13629 lines, and the npm packages `@base-ui/react`, `@internationalized/date`, `@mantine/hooks`, `@phosphor-icons/react`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## Built on

- [Avatar](https://gelatinui.com/components/avatar.md)
- [Badge](https://gelatinui.com/components/badge.md)
- [Button](https://gelatinui.com/components/button.md)
- [Empty](https://gelatinui.com/components/empty.md)
- [Popover](https://gelatinui.com/components/popover.md)
- [Segmented Control](https://gelatinui.com/components/segmented-control.md)
- [Skeleton](https://gelatinui.com/components/skeleton.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Calendar](https://gelatinui.com/components/calendar.md)
- [Time Slots](https://gelatinui.com/components/time-slots.md)
- [Week Strip](https://gelatinui.com/components/week-strip.md)
- [Date Picker](https://gelatinui.com/components/date-picker.md)
- [Timeline](https://gelatinui.com/components/timeline.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves into the view. The view is one tab stop. |
| Up Arrow, Down Arrow, Left Arrow, Right Arrow | Moves the focus between slots, days, and events. |
| Alt + Arrow | Moves the focused event by one slot or one day. |
| Shift + Alt + Arrow | Makes the focused event longer or shorter. |
| Enter | Opens the details of the focused event, or asks for a new event on a free slot. |
| Space | Selects the focused event, or saves a key move. |
| Esc | Puts a key move back, closes the details, or clears the selection. |

## Accessibility

Each event is a button whose name holds its title and its time.

The details popup takes its name from the event title and its description from the day and time.

Every move and resize also works with keys, with no drag.

Touch: hold an event to lift it; a selected event shows its resize handle.

## Motion

| Part | Motion |
| --- | --- |
| Details | popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1) · fades in and scales from 95% |
| Error bar | fade · 150ms · fades in over the grid |
| Drag | press · the lifted event follows the pointer and snaps to its slot; a view change or a key move does not animate |
